New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@tfk-samf/figma-to-dtcg

Package Overview
Dependencies
Maintainers
0
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tfk-samf/figma-to-dtcg - npm Package Compare versions

Comparing version 0.2.0 to 0.3.0

5

dist/index.d.ts

@@ -1,2 +0,2 @@

import { RGB, GetLocalVariablesResponse } from '@figma/rest-api-spec';
import { RGB, LocalVariable, GetLocalVariablesResponse } from '@figma/rest-api-spec';
/**

@@ -32,3 +32,4 @@ * Configure this package for the Figma Variables Rest API.

};
export type DesignTokenType = 'color' | 'number';
export type DesignTokenType = 'color' | 'number' | 'fontFamily' | 'boolean';
export type FigmaTokenType = LocalVariable["resolvedType"];
export type DesignToken = {

@@ -35,0 +36,0 @@ type: DesignTokenType;

11

dist/index.js

@@ -0,1 +1,7 @@

const figmaDesignTokenTypeMap = {
'COLOR': 'color',
'FLOAT': 'number',
'STRING': 'fontFamily',
'BOOLEAN': 'boolean'
};
let getVariableById;

@@ -141,3 +147,3 @@ /**

const value = valuesByMode[keyToId[mode]];
if (value !== undefined && ['COLOR', 'FLOAT'].includes(resolvedType)) {
if (value !== undefined && ['COLOR', 'FLOAT', 'STRING'].includes(resolvedType)) {
const groups = name.split('/');

@@ -152,3 +158,3 @@ if (groups.some((group) => isPrivate(group)))

obj.value = await valueToJSON(name, value, resolvedType);
obj.type = (resolvedType === 'COLOR' ? 'color' : 'number');
obj.type = figmaDesignTokenTypeMap[resolvedType];
obj.prefix = collectionPrefix;

@@ -184,3 +190,2 @@ }

}
// console.log("tokens", JSON.stringify(tree, null, 2))
return {

@@ -187,0 +192,0 @@ tokens: tree,

{
"name": "@tfk-samf/figma-to-dtcg",
"version": "0.2.0",
"version": "0.3.0",
"description": "Parse Figma Variables Plugin API and REST API into design tokens.",

@@ -35,3 +35,3 @@ "files": [

},
"gitHead": "67a5a2e8eeb01457256a85b76ad319272a820b09"
"gitHead": "2c3d5d013a37c46e3c026fd3f7c75fcdf39a1129"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc