From b12c09f4f549361359a778f6d9bd77cbe26516c8 Mon Sep 17 00:00:00 2001 From: Joren Broekema Date: Thu, 4 Jul 2024 16:06:45 +0200 Subject: [PATCH] chore: small fix for platform config usage (#295) --- src/register.ts | 2 +- test/spec/checkAndEvaluateMath.spec.ts | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/register.ts b/src/register.ts index 169812e..28feec4 100644 --- a/src/register.ts +++ b/src/register.ts @@ -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({ diff --git a/test/spec/checkAndEvaluateMath.spec.ts b/test/spec/checkAndEvaluateMath.spec.ts index 9f5b63e..ee3cb6e 100644 --- a/test/spec/checkAndEvaluateMath.spec.ts +++ b/test/spec/checkAndEvaluateMath.spec.ts @@ -127,9 +127,7 @@ describe('check and evaluate math', () => { platforms: { css: { transformGroup: 'tokens-studio', - options: { - mathFractionDigits: 3, - }, + mathFractionDigits: 3, files: [ { format: 'css/variables',