4
0

isMathFunction.mjs 381 B

1234567891011
  1. import { mathFunctions } from '../reference/functions.mjs';
  2. /**
  3. * Check whether a node is math function
  4. *
  5. * @param {import('postcss-value-parser').Node} node postcss-value-parser node
  6. * @returns {boolean} If `true`, the node is math function
  7. */
  8. export default function isMathFunction(node) {
  9. return node.type === 'function' && mathFunctions.has(node.value.toLowerCase());
  10. }