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