Socket
Book a DemoInstallSign in
Socket

@primer/primitives

Package Overview
Dependencies
Maintainers
15
Versions
4720
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@primer/primitives - npm Package Compare versions

Comparing version

to
0.0.0-20250124091336

dist/build/platforms/utilities/outputReferencesFilterObject.d.ts

8

dist/build/formats/utilities/createPropertyFormatterWithRef.js

@@ -154,3 +154,5 @@ import { getReferences, usesReferences } from 'style-dictionary/utils';

.map((prop, index) => {
if (originalValue[prop].startsWith('{')) {
var _a;
if (originalValue[prop].startsWith('{') &&
((_a = refs.find(ref => ref.path.join('.') === originalValue[prop].replace(/[{}]/g, ''))) === null || _a === void 0 ? void 0 : _a.isSource) === true) {
return originalValue[prop];

@@ -186,3 +188,4 @@ }

// technically speaking a reference can be made to a number or boolean token, in this case we stringify it first
value = `${value}`.replace(value.match(/{/) ? new RegExp(`{${ref.path.join('\\.')}(\\.\\$?value)?}`, 'g') : refVal, replaceFunc);
const regex = new RegExp(`{${ref.path.join('\\.')}(\\.\\$?value)?}`, 'g');
value = `${value}`.replace(regex, replaceFunc);
}

@@ -201,5 +204,4 @@ });

}
// console.log('toRetToken', toRetToken)
return toRetToken;
};
}
import { isFromFile, isSource } from '../filters/index.js';
import { outputReferencesTransformed, outputReferencesFilter } from 'style-dictionary/utils';
import { outputReferencesTransformedWithObject } from './utilities/outputReferencesTransformedWithObject.js';
import { outputReferencesFilterObject } from './utilities/outputReferencesFilterObject.js';
const getCssSelectors = (outputFile) => {

@@ -56,4 +57,6 @@ // check for dark in the beginning of the output filename

// outputReferences: true,
outputReferences: (token, platformOptions) => outputReferencesFilter(token, platformOptions) &&
outputReferencesTransformedWithObject(token, platformOptions), descriptions: false, queries: getCssSelectors(outputFile) }, options === null || options === void 0 ? void 0 : options.options),
outputReferences: (token, platformOptions) => {
return (outputReferencesFilterObject(token, platformOptions) &&
outputReferencesTransformedWithObject(token, platformOptions));
}, descriptions: false, queries: getCssSelectors(outputFile) }, options === null || options === void 0 ? void 0 : options.options),
},

@@ -60,0 +63,0 @@ {

@@ -19,10 +19,10 @@ import { resolveReferences } from 'style-dictionary/utils';

if (typeof originalValue === 'object') {
const values = Object.values(originalValue).filter(val => typeof val === 'string');
return values.every(val => {
const originalValues = Object.values(originalValue).filter(val => typeof val === 'string');
return originalValues.some(origVal => {
var _a;
const resolvedValue = resolveReferences(val, (_a = dictionary.unfilteredTokens) !== null && _a !== void 0 ? _a : dictionary.tokens, {
const resolvedValue = resolveReferences(origVal, (_a = dictionary.unfilteredTokens) !== null && _a !== void 0 ? _a : dictionary.tokens, {
usesDtcg,
warnImmediately: false,
});
return typeof resolvedValue === 'string' ? values.includes(resolvedValue) : true;
return typeof resolvedValue === 'string' ? value.split(' ').includes(resolvedValue) : false;
});

@@ -29,0 +29,0 @@ }

{
"name": "@primer/primitives",
"version": "0.0.0-20250123103827",
"version": "0.0.0-20250124091336",
"description": "Typography, spacing, and color primitives for Primer design system",

@@ -5,0 +5,0 @@ "type": "module",

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 too big to display

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

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

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

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

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

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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.