UNPKG

style-dictionary-utils

Version:
17 lines (16 loc) 553 B
import { isDeprecated } from '../filter/isDeprecated.js'; /** * commentDeprecated * @description replaces the comment of a token with the deprecated comment */ export const commentDeprecated = { name: 'comment/deprecated', type: `attribute`, transitive: true, filter: isDeprecated, transform: (token) => { const deprecated = token.deprecated || token.$deprecated; token.$description = `DEPRECATED${typeof deprecated === 'string' && deprecated !== 'true' ? `: ${deprecated}` : ''}`; return token; }, };