Skip to content

Commit

Permalink
chore: small fix for platform config usage (#295)
Browse files Browse the repository at this point in the history
  • Loading branch information
jorenbroekema authored Jul 4, 2024
1 parent 9c02741 commit b12c09f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/register.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export async function register(sd: typeof StyleDictionary, transformOpts?: Trans
type: 'value',
transitive: true,
filter: token => ['string', 'object'].includes(typeof (token.$value ?? token.value)),
transform: (token, config) => checkAndEvaluateMath(token, config.options?.mathFractionDigits),
transform: (token, platformCfg) => checkAndEvaluateMath(token, platformCfg.mathFractionDigits),
});

sd.registerTransform({
Expand Down
4 changes: 1 addition & 3 deletions test/spec/checkAndEvaluateMath.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,7 @@ describe('check and evaluate math', () => {
platforms: {
css: {
transformGroup: 'tokens-studio',
options: {
mathFractionDigits: 3,
},
mathFractionDigits: 3,
files: [
{
format: 'css/variables',
Expand Down

0 comments on commit b12c09f

Please sign in to comment.