math js parser dependencies
const numeric = require("numeric")
function deepMap (array, callback, skipZeros) {
if (array && (typeof array.map === 'function')) {
return array.map(function (x) {
return deepMap(x, callback, skipZeros)
})
} else {
return callback(array)
}
}
function isAccessorNode (x) {
return (x && x.isAccessorNode === true && x.constructor.prototype.isNode === true) || false
}
function isConstantNode (x) {
return (x && x.isConstantNode === true && x.constructor.prototype.isNode === true) || false
}
function isFunctionNode (x) {
return (x && x.isFunctionNode === true && x.constructor.prototype.isNode === true) || false
}
function isOperatorNode (x) {
return (x && x.isOperatorNode === true && x.constructor.prototype.isNode === true) || false
}
function isSymbolNode (x) {
return (x && x.isSymbolNode === true && x.constructor.prototype.isNode === true) || false
}
module.exports = {deepMap, numeric, isAccessorNode,isConstantNode, isFunctionNode, isOperatorNode, isSymbolNode}
no comments