isMathFunction.js 399 B

12345678910111213
  1. 'use strict';
  2. const { mathFunctions } = require('../reference/functions');
  3. /**
  4. * Check whether a node is math function
  5. *
  6. * @param {import('postcss-value-parser').Node} node postcss-value-parser node
  7. * @return {boolean} If `true`, the node is math function
  8. */
  9. module.exports = function isMathFunction(node) {
  10. return node.type === 'function' && mathFunctions.has(node.value.toLowerCase());
  11. };