mathjs
Version:
Math.js is an extensive math library for JavaScript and Node.js. It features a flexible expression parser and offers an integrated solution to work with numbers, big numbers, complex numbers, units, and matrices.
28 lines (23 loc) • 670 B
JavaScript
;
var errorTransform = require('./error.transform').transform;
var isBoolean = require('../../util/boolean').isBoolean;
var argsToArray = require('../../util/array').argsToArray;
/**
* Attach a transform function to math.subset
* Adds a property transform containing the transform function.
*
* This transform creates a range which includes the end value
* @param {Object} math
*/
module.exports = function (math) {
var transform = function () {
try {
return math.subset.apply(math, argsToArray(arguments));
}
catch (err) {
throw errorTransform(err);
}
};
math.subset.transform = transform;
return transform;
};