Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

figmagic

Package Overview
Dependencies
Maintainers
1
Versions
151
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

figmagic - npm Package Compare versions

Comparing version 4.2.16 to 4.2.17

13

__tests__/entities/Token/logic/makeColorTokens.test.ts
import { makeColorTokens } from '../../../../bin/entities/Token/logic/makeColorTokens';
import {
colorFrame,
colorFrameOpacity,
colorFrameInvalid
} from '../../../../testdata/frames/colorFrame';
import { colorFrame, colorFrameOpacity } from '../../../../testdata/frames/colorFrame';

@@ -17,9 +13,2 @@ describe('Failure cases', () => {

test('It should throw an error if frame has "color" property but not "color.fills"', () => {
expect(() => {
// @ts-ignore
makeColorTokens(colorFrameInvalid);
}).toThrow();
});
test('It should throw an error if no argument is provided', () => {

@@ -26,0 +15,0 @@ expect(() => {

6

bin/entities/Token/logic/makeColorTokens.ts

@@ -11,4 +11,3 @@ import { FRAME as Frame } from '../../../contracts/Figma';

ErrorMakeColorTokensNoFrame,
ErrorMakeColorTokensNoChildren,
ErrorMakeColorTokensNoFills
ErrorMakeColorTokensNoChildren
} from '../../../frameworks/errors/errors';

@@ -32,4 +31,3 @@

// @ts-ignore
if (!item.fills) throw new Error(ErrorMakeColorTokensNoFills);
if (!item.fills[0]) throw new Error(ErrorMakeColorTokensNoFills);
if (!item.fills || item.fills.length === 0) return null;

@@ -36,0 +34,0 @@ const NAME = camelize(item.name);

@@ -139,3 +139,2 @@ import { colors } from '../system/colors';

export const ErrorMakeColorTokensNoChildren = ErrorMessage('Color tokens frame has no children!');
export const ErrorMakeColorTokensNoFills = ErrorMessage('Color has no "fills" property!');
export const ErrorMakeColorTokensNoFrame = ErrorMessage('No frame for makeColorTokens()!');

@@ -142,0 +141,0 @@ export const ErrorMakeDelayTokensMissingProps = ErrorMessage(

@@ -21,6 +21,4 @@ "use strict";

function makeColorToken(item, colors) {
if (!item.fills)
throw new Error(errors_1.ErrorMakeColorTokensNoFills);
if (!item.fills[0])
throw new Error(errors_1.ErrorMakeColorTokensNoFills);
if (!item.fills || item.fills.length === 0)
return null;
const NAME = camelize_1.camelize(item.name);

@@ -27,0 +25,0 @@ const FILLS = item.fills[0];

@@ -62,3 +62,2 @@ export declare const ErrorAddDescriptionToElements: string;

export declare const ErrorMakeColorTokensNoChildren: string;
export declare const ErrorMakeColorTokensNoFills: string;
export declare const ErrorMakeColorTokensNoFrame: string;

@@ -65,0 +64,0 @@ export declare const ErrorMakeDelayTokensMissingProps: string;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ErrorGetSvgFileData = exports.ErrorGetTokenMatch = exports.ErrorGetPaddingY = exports.ErrorGetPaddingX = exports.ErrorGetIntersectingValues = exports.ErrorGetIdstring = exports.ErrorGetIds = exports.ErrorGetFromApi = exports.ErrorGetFontColor = exports.ErrorGetFiles = exports.ErrorGetFileList = exports.ErrorGetFileContents = exports.ErrorGetFileContentAndPathNoReturn = exports.ErrorGetFileContentAndPathMissingFields = exports.ErrorGetFileContentAndPath = exports.ErrorGetFigmaDocumentId = exports.ErrorGetDescription = exports.ErrorGetDataNoTokenOrUrl = exports.ErrorGetDataNoData = exports.ErrorGetDataLocal = exports.ErrorGetDataFailedLocalAndRemote = exports.ErrorGetData = exports.ErrorGetAlphaInPercent = exports.ErrorFindShortenedNameMatchWrongType = exports.ErrorFigmagicController = exports.ErrorExtractTokensNoConfig = exports.ErrorExtractTokens = exports.ErrorExtractDescription = exports.ErrorDownloadFile = exports.ErrorCreateTokens = exports.ErrorCreateSolidColorString = exports.ErrorCreatePage = exports.ErrorCreateRadialGradientString = exports.ErrorCreateLinearGradientString = exports.ErrorCreateImportStringFromListZeroLength = exports.ErrorCreateImportStringFromList = exports.ErrorCreateGraphics = exports.ErrorCreateFolder = exports.ErrorCreateEnumStringOutOfObject = exports.ErrorCreateElements = exports.ErrorCreateCssString = exports.ErrorCreateConfigurationNoDefault = exports.ErrorConvertRgbaToHex = exports.ErrorConvertHexToRgba = exports.ErrorCleanSvgData = exports.ErrorCleanArrays = exports.ErrorCheckIfStringOnlyContainsReturnsOrSpaces = exports.ErrorCamelize = exports.ErrorCalculateDegree2Point = exports.ErrorAddDescriptionToElements = void 0;
exports.ErrorMakeSpacingTokensNoChildren = exports.ErrorMakeSpacingTokensMissingProps = exports.ErrorMakeShadowTokensNoFrame = exports.ErrorMakeShadowTokensNoChildren = exports.ErrorMakeShadowTokensMissingProps = exports.ErrorMakeRadiusTokensNoFrame = exports.ErrorMakeRadiusTokensNoChildren = exports.ErrorMakeRadiusTokensMissingProps = exports.ErrorMakeOpacityTokensNoFrame = exports.ErrorMakeOpacityTokensNoChildren = exports.ErrorMakeOpacityTokensMissingProps = exports.ErrorMakeLineHeightTokensNoFrame = exports.ErrorMakeLineHeightTokensNoChildren = exports.ErrorMakeLetterSpacingTokensNoFrame = exports.ErrorMakeLetterSpacingTokensNoChildren = exports.ErrorMakeLetterSpacingTokensMissingProps = exports.ErrorMakeFontWeightTokensNoFrame = exports.ErrorMakeFontWeightTokensNoChildren = exports.ErrorMakeFontWeightTokensMissingWeight = exports.ErrorMakeFontWeightTokensMissingProps = exports.ErrorMakeFontTokensNoFrame = exports.ErrorMakeFontTokensNoChildren = exports.ErrorMakeFontTokensMissingProps = exports.ErrorMakeFontSizeTokensNoSizing = exports.ErrorMakeFontSizeTokensNoFrame = exports.ErrorMakeFontSizeTokensNoChildren = exports.ErrorMakeFontSizeTokensMissingSize = exports.ErrorMakeFontSizeTokensMissingProps = exports.ErrorMakeEasingTokensNoFrame = exports.ErrorMakeEasingTokensNoChildren = exports.ErrorMakeEasingTokensMissingProps = exports.ErrorMakeDurationTokensNoFrame = exports.ErrorMakeDurationTokensNoChildren = exports.ErrorMakeDurationTokensMissingProps = exports.ErrorMakeDelayTokensNoFrame = exports.ErrorMakeDelayTokensNoChildren = exports.ErrorMakeDelayTokensMissingProps = exports.ErrorMakeColorTokensNoFrame = exports.ErrorMakeColorTokensNoFills = exports.ErrorMakeColorTokensNoChildren = exports.ErrorMakeBorderWidthTokensNoFrame = exports.ErrorMakeBorderWidthTokensNoChildren = exports.ErrorMakeBorderWidthTokensMissingProps = exports.ErrorGetShadow = exports.ErrorGetBorderColor = exports.ErrorGetBackgroundColor = exports.ErrorLoadFile = exports.ErrorHandleNestedElements = exports.ErrorGetUniqueValues = exports.ErrorGetTokenMatchNoRemSize = void 0;
exports.ErrorValidateConfigOutputDataTypeToken = exports.ErrorValidateConfigOpacitiesUnit = exports.ErrorValidateConfigLetterSpacingUnit = exports.ErrorValidateConfigFontUnit = exports.ErrorValidateConfigFolderName = exports.ErrorValidateConfigFileName = exports.ErrorValidateConfig = exports.ErrorUpdateParsing = exports.ErrorToPascalCase = exports.ErrorSliceOutObjectFromFile = exports.ErrorSetupMediaQueryTokensNoFrame = exports.ErrorSetupMediaQueryTokensNoChildren = exports.ErrorSetupMediaQueryTokensMissingProps = exports.ErrorRoundColorValue = exports.ErrorRoundColor = exports.ErrorReplaceMediaQuery = exports.ErrorRefresh = exports.ErrorProcessNestedCss = exports.ErrorProcessGraphicsNoImages = exports.ErrorProcessGraphicElementsMap = exports.ErrorProcessGraphicsImageError = exports.ErrorProcessGraphics = exports.ErrorProcessElementsNoMainElement = exports.ErrorProcessElements = exports.ErrorPrepareWrite = exports.ErrorPrepFileGraphicComponent = exports.ErrorPrepFileStyledComponents = exports.ErrorPrepFileStorybook = exports.ErrorPrepFileDescription = exports.ErrorPrepFileCss = exports.ErrorPrepFileComponent = exports.ErrorParseTypographyStylingFromElement = exports.ErrorParseShadow = exports.ErrorParsePadding = exports.ErrorParseHeight = exports.ErrorParseElement = exports.ErrorParseCssFromElement = exports.ErrorParseCliArgs = exports.ErrorParseBorderWidth = exports.ErrorParseBorderRadius = exports.ErrorParseBorderColor = exports.ErrorParseBackgroundColor = exports.ErrorNormalizeUnitsUndefined = exports.ErrorNormalizeUnitsNoRemSize = exports.ErrorNormalizeUnits = exports.ErrorMakeZindexTokensNoFrame = exports.ErrorMakeZindexTokensNoChildren = exports.ErrorMakeZindexTokensMissingProps = exports.ErrorMakeSpacingTokensNoUnits = exports.ErrorMakeSpacingTokensNoFrame = void 0;
exports.ErrorWriteTokensNoSettings = exports.ErrorWriteTokens = exports.ErrorWriteGraphicElementsMap = exports.ErrorWriteGraphics = exports.ErrorWriteFileWrongType = exports.ErrorWriteFile = exports.ErrorWriteElements = exports.ErrorWriteBaseJson = exports.ErrorWrite = exports.ErrorValidateConfigTemplatePathGraphic = exports.ErrorValidateConfigTemplatePathStyled = exports.ErrorValidateConfigTemplatePathStorybook = exports.ErrorValidateConfigTemplatePathReact = exports.ErrorValidateConfigSpacingUnit = exports.ErrorValidateConfigOutputScaleGraphics = exports.ErrorValidateConfigOutputFormatTokens = exports.ErrorValidateConfigOutputFormatStorybook = exports.ErrorValidateConfigOutputFormatGraphics = exports.ErrorValidateConfigOutputFormatElements = exports.ErrorValidateConfigOutputFormatDesc = exports.ErrorValidateConfigOutputFormatCss = void 0;
exports.ErrorMakeSpacingTokensNoFrame = exports.ErrorMakeSpacingTokensNoChildren = exports.ErrorMakeSpacingTokensMissingProps = exports.ErrorMakeShadowTokensNoFrame = exports.ErrorMakeShadowTokensNoChildren = exports.ErrorMakeShadowTokensMissingProps = exports.ErrorMakeRadiusTokensNoFrame = exports.ErrorMakeRadiusTokensNoChildren = exports.ErrorMakeRadiusTokensMissingProps = exports.ErrorMakeOpacityTokensNoFrame = exports.ErrorMakeOpacityTokensNoChildren = exports.ErrorMakeOpacityTokensMissingProps = exports.ErrorMakeLineHeightTokensNoFrame = exports.ErrorMakeLineHeightTokensNoChildren = exports.ErrorMakeLetterSpacingTokensNoFrame = exports.ErrorMakeLetterSpacingTokensNoChildren = exports.ErrorMakeLetterSpacingTokensMissingProps = exports.ErrorMakeFontWeightTokensNoFrame = exports.ErrorMakeFontWeightTokensNoChildren = exports.ErrorMakeFontWeightTokensMissingWeight = exports.ErrorMakeFontWeightTokensMissingProps = exports.ErrorMakeFontTokensNoFrame = exports.ErrorMakeFontTokensNoChildren = exports.ErrorMakeFontTokensMissingProps = exports.ErrorMakeFontSizeTokensNoSizing = exports.ErrorMakeFontSizeTokensNoFrame = exports.ErrorMakeFontSizeTokensNoChildren = exports.ErrorMakeFontSizeTokensMissingSize = exports.ErrorMakeFontSizeTokensMissingProps = exports.ErrorMakeEasingTokensNoFrame = exports.ErrorMakeEasingTokensNoChildren = exports.ErrorMakeEasingTokensMissingProps = exports.ErrorMakeDurationTokensNoFrame = exports.ErrorMakeDurationTokensNoChildren = exports.ErrorMakeDurationTokensMissingProps = exports.ErrorMakeDelayTokensNoFrame = exports.ErrorMakeDelayTokensNoChildren = exports.ErrorMakeDelayTokensMissingProps = exports.ErrorMakeColorTokensNoFrame = exports.ErrorMakeColorTokensNoChildren = exports.ErrorMakeBorderWidthTokensNoFrame = exports.ErrorMakeBorderWidthTokensNoChildren = exports.ErrorMakeBorderWidthTokensMissingProps = exports.ErrorGetShadow = exports.ErrorGetBorderColor = exports.ErrorGetBackgroundColor = exports.ErrorLoadFile = exports.ErrorHandleNestedElements = exports.ErrorGetUniqueValues = exports.ErrorGetTokenMatchNoRemSize = void 0;
exports.ErrorValidateConfigOutputFormatCss = exports.ErrorValidateConfigOutputDataTypeToken = exports.ErrorValidateConfigOpacitiesUnit = exports.ErrorValidateConfigLetterSpacingUnit = exports.ErrorValidateConfigFontUnit = exports.ErrorValidateConfigFolderName = exports.ErrorValidateConfigFileName = exports.ErrorValidateConfig = exports.ErrorUpdateParsing = exports.ErrorToPascalCase = exports.ErrorSliceOutObjectFromFile = exports.ErrorSetupMediaQueryTokensNoFrame = exports.ErrorSetupMediaQueryTokensNoChildren = exports.ErrorSetupMediaQueryTokensMissingProps = exports.ErrorRoundColorValue = exports.ErrorRoundColor = exports.ErrorReplaceMediaQuery = exports.ErrorRefresh = exports.ErrorProcessNestedCss = exports.ErrorProcessGraphicsNoImages = exports.ErrorProcessGraphicElementsMap = exports.ErrorProcessGraphicsImageError = exports.ErrorProcessGraphics = exports.ErrorProcessElementsNoMainElement = exports.ErrorProcessElements = exports.ErrorPrepareWrite = exports.ErrorPrepFileGraphicComponent = exports.ErrorPrepFileStyledComponents = exports.ErrorPrepFileStorybook = exports.ErrorPrepFileDescription = exports.ErrorPrepFileCss = exports.ErrorPrepFileComponent = exports.ErrorParseTypographyStylingFromElement = exports.ErrorParseShadow = exports.ErrorParsePadding = exports.ErrorParseHeight = exports.ErrorParseElement = exports.ErrorParseCssFromElement = exports.ErrorParseCliArgs = exports.ErrorParseBorderWidth = exports.ErrorParseBorderRadius = exports.ErrorParseBorderColor = exports.ErrorParseBackgroundColor = exports.ErrorNormalizeUnitsUndefined = exports.ErrorNormalizeUnitsNoRemSize = exports.ErrorNormalizeUnits = exports.ErrorMakeZindexTokensNoFrame = exports.ErrorMakeZindexTokensNoChildren = exports.ErrorMakeZindexTokensMissingProps = exports.ErrorMakeSpacingTokensNoUnits = void 0;
exports.ErrorWriteTokensNoSettings = exports.ErrorWriteTokens = exports.ErrorWriteGraphicElementsMap = exports.ErrorWriteGraphics = exports.ErrorWriteFileWrongType = exports.ErrorWriteFile = exports.ErrorWriteElements = exports.ErrorWriteBaseJson = exports.ErrorWrite = exports.ErrorValidateConfigTemplatePathGraphic = exports.ErrorValidateConfigTemplatePathStyled = exports.ErrorValidateConfigTemplatePathStorybook = exports.ErrorValidateConfigTemplatePathReact = exports.ErrorValidateConfigSpacingUnit = exports.ErrorValidateConfigOutputScaleGraphics = exports.ErrorValidateConfigOutputFormatTokens = exports.ErrorValidateConfigOutputFormatStorybook = exports.ErrorValidateConfigOutputFormatGraphics = exports.ErrorValidateConfigOutputFormatElements = exports.ErrorValidateConfigOutputFormatDesc = void 0;
const colors_1 = require("../system/colors");

@@ -77,3 +77,2 @@ function ErrorMessage(str) {

exports.ErrorMakeColorTokensNoChildren = ErrorMessage('Color tokens frame has no children!');
exports.ErrorMakeColorTokensNoFills = ErrorMessage('Color has no "fills" property!');
exports.ErrorMakeColorTokensNoFrame = ErrorMessage('No frame for makeColorTokens()!');

@@ -80,0 +79,0 @@ exports.ErrorMakeDelayTokensMissingProps = ErrorMessage('Missing "name" or "characters" properties in Delay frame!');

@@ -17,3 +17,3 @@ {

},
"version": "4.2.16",
"version": "4.2.17",
"author": "Mikael Vesavuori",

@@ -20,0 +20,0 @@ "contributors": [

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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