style-dictionary-utils
Version:
Utilities to use in your style dictionary config
9 lines (8 loc) • 357 B
JavaScript
/**
* @name getHasAttribute
* @type filter
* @description only returns tokens of that have any of the specified attributes
* @param attributes one more multiple attributes (`strings`)
* @returns filter function
*/
export const getHasAttribute = (...attributes) => (token) => attributes.some(attr => Object.prototype.hasOwnProperty.call(token, attr));