Skip to content

Commit

Permalink
fix: Rename dimension to unit
Browse files Browse the repository at this point in the history
  • Loading branch information
RayRedGoose committed Oct 19, 2023
1 parent 8c6ce59 commit 90025ee
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/canvas-tokens/utils/tokenStudioParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ export const tokenStudioParser = ({contents}: any) => {
}

if (parsed.base) {
const {dimension} = parsed.base.base;
const {unit} = parsed.base.base;
delete parsed.base.base;
parsed.base.dimension = dimension;
parsed.base.unit = unit;
}

const updateTokens = (token: DesignToken) => {
Expand Down Expand Up @@ -96,11 +96,15 @@ const replaceByFullRef = (value: string) => {
const getKeys = (obj: object): string[] => Object.keys(obj);

const mapObjectContent = (fn: (token: DesignToken) => DesignToken, obj: DesignToken) => {
console.log(obj);

if (obj.value) {
return fn(obj);
}

const keys = getKeys(obj);
console.log(keys);

keys.forEach(key => {
mapObjectContent(fn, obj[key]);
});
Expand Down

0 comments on commit 90025ee

Please sign in to comment.