Skip to content

Commit

Permalink
fix references
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasoppermann committed Jul 7, 2023
1 parent a8f8f6b commit 5530d99
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/formats/jsonFigma.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const getReference = (dictionary: StyleDictionary.Dictionary, refString: string)
// retrieve reference token
const refToken = dictionary.getReferences(refString)[0]
// return full reference
return [refToken.collection, ...refToken.path].filter(Boolean).join('/')
return [refToken.attributes?.collection, ...refToken.path].filter(Boolean).join('/')
}
return undefined
}
Expand Down Expand Up @@ -41,6 +41,7 @@ export const jsonFigma: StyleDictionary.Formatter = ({
const {attributes, value, $type, comment: description, original, alpha, mix} = token
const {mode, collection, scopes} = attributes || {}
const tokenName = token.name.replace(replaceRegEx, '')
console.log(token.name, original.value, getReference(dictionary, original.value))

Check failure on line 44 in src/formats/jsonFigma.ts

View workflow job for this annotation

GitHub Actions / Build verification

Unexpected console statement
return {
name: tokenName,
value,
Expand Down

0 comments on commit 5530d99

Please sign in to comment.