mirror of
https://github.com/josdejong/mathjs.git
synced 2026-01-18 14:59:29 +00:00
28 lines
649 B
JavaScript
28 lines
649 B
JavaScript
'use strict'
|
|
|
|
const errorTransform = require('./error.transform').transform
|
|
|
|
/**
|
|
* 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
|
|
*/
|
|
function factory (type, config, load, typed) {
|
|
const subset = load(require('../../function/matrix/subset'))
|
|
|
|
return typed('subset', {
|
|
'...any': function (args) {
|
|
try {
|
|
return subset.apply(null, args)
|
|
} catch (err) {
|
|
throw errorTransform(err)
|
|
}
|
|
}
|
|
})
|
|
}
|
|
|
|
exports.name = 'subset'
|
|
exports.path = 'expression.transform'
|
|
exports.factory = factory
|