figma-tokens-flattener 1.0.8 → 1.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +2 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -470,14 +470,14 @@ function flattenComponentsTokens(componentsTokens, contextTokens) {
470
470
  Object.keys(componentTokens).forEach(tokenName => {
471
471
  const tokenDefinition = componentTokens[tokenName];
472
472
 
473
- if (tokenDefinition && typeof tokenDefinition === 'object' && tokenDefinition.hasOwnProperty('value')) {
473
+ if (tokenDefinition && typeof tokenDefinition === 'object' && Object.hasOwn(tokenDefinition, 'value')) {
474
474
  const rawValue = tokenDefinition.value;
475
475
 
476
476
  const processedValue = flattenMapTokens(rawValue, contextTokens);
477
477
  processedComponentTokens[tokenName] = processedValue;
478
478
  } else {
479
479
  // It can be a token with a nested structure, for example, lineType.style.value
480
- if (tokenDefinition && typeof tokenDefinition === 'object' && tokenDefinition.style && typeof tokenDefinition.style === 'object' && tokenDefinition.style.hasOwnProperty('value')) {
480
+ if (tokenDefinition && typeof tokenDefinition === 'object' && tokenDefinition.style && typeof tokenDefinition.style === 'object' && Object.hasOwn(tokenDefinition.style, 'value')) {
481
481
  const rawValue = tokenDefinition.style.value;
482
482
 
483
483
  const processedValue = flattenMapTokens(rawValue, contextTokens);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "figma-tokens-flattener",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "description": "A tool for transforming Ant Design tokens from Tokens Studio for Figma (Single file) into flat style mappings for light and dark themes.",
5
5
  "main": "index.js",
6
6
  "bin": {