style-dictionary-utils
Version:
Utilities to use in your style dictionary config
14 lines (13 loc) • 379 B
JavaScript
/**
* @name isDeprecated
* @type filter
* @description only returns tokens with $deprecated = true or $deprecated = string
*/
export const isDeprecatedFilter = (token) => {
const deprecated = token.$deprecated;
return deprecated === true || typeof deprecated === 'string';
};
export const isDeprecated = {
name: 'isDeprecated',
filter: isDeprecatedFilter,
};