UNPKG

700 BJavaScriptView Raw
1'use strict';
2/**
3 * Attach a transform function to math.range
4 * Adds a property transform containing the transform function.
5 *
6 * This transform creates a range which includes the end value
7 */
8
9function factory(type, config, load, typed) {
10 var range = load(require('../../function/matrix/range'));
11 return typed('range', {
12 '...any': function any(args) {
13 var lastIndex = args.length - 1;
14 var last = args[lastIndex];
15
16 if (typeof last !== 'boolean') {
17 // append a parameter includeEnd=true
18 args.push(true);
19 }
20
21 return range.apply(null, args);
22 }
23 });
24}
25
26exports.name = 'range';
27exports.path = 'expression.transform';
28exports.factory = factory;
\No newline at end of file