mirror of
https://github.com/josdejong/mathjs.git
synced 2026-01-18 14:59:29 +00:00
29 lines
731 B
JavaScript
29 lines
731 B
JavaScript
'use strict';
|
|
|
|
function factory (type, config, load, typed) {
|
|
var simplify = load(require('./simplify'));
|
|
|
|
/**
|
|
* A transformation for the simplify function. This transformation will be
|
|
* invoked when the function is used via the expression parser of math.js.
|
|
*
|
|
* @param {Array.<Node>} args
|
|
* Expects the following arguments: [f, x]
|
|
* @param {Object} math
|
|
* @param {Object} [scope]
|
|
*/
|
|
var simplifyTransform = typed('simplify', {
|
|
'Array, Object, Object': function (args) {
|
|
return simplify.apply(null, args);
|
|
}
|
|
});
|
|
|
|
simplifyTransform.rawArgs = true;
|
|
|
|
return simplifyTransform;
|
|
}
|
|
|
|
exports.name = 'simplify';
|
|
exports.path = 'expression.transform';
|
|
exports.factory = factory;
|