Skip to content

Commit

Permalink
Fix tokenizing when only nodeId tokens are defined
Browse files Browse the repository at this point in the history
  • Loading branch information
Temzasse committed Nov 13, 2023
1 parent b3a0fdf commit 756bc65
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/tokenizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ export default class Tokenizer {
}

async handleStyles() {
const customTokens = this.config.tokenize.tokens.filter((t) =>
Boolean(t.nodeId)
);

// If there are no style tokens, return early
if (this.config.tokenize.tokens.length === customTokens.length) {
return;
}

const styles = await this.figmaAPI.fetchStyles();

const stylesById = styles.reduce((acc, style) => {
Expand Down

0 comments on commit 756bc65

Please sign in to comment.