UNPKG

style-dictionary-utils

Version:
20 lines (19 loc) 562 B
import { getValue } from '../utilities/getValue.js'; /** * @name isClamp * @type filter * @description only returns tokens of type `shadow` */ export const isClampFilter = (token) => { const tokenValue = getValue(token); return ((token === null || token === void 0 ? void 0 : token.$type) === 'clamp' && tokenValue !== null && typeof tokenValue === 'object' && 'min' in tokenValue && 'ideal' in tokenValue && 'max' in tokenValue); }; export const isClamp = { name: 'isClamp', filter: isClampFilter, };