UNPKG

mathjs

Version:

Math.js is an extensive math library for JavaScript and Node.js. It features a flexible expression parser with support for symbolic computation, comes with a large set of built-in functions and constants, and offers an integrated solution to work with dif

21 lines (20 loc) 572 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.lastDimToZeroBase = lastDimToZeroBase; var _is = require("../../../utils/is.js"); var _dimToZeroBase = require("./dimToZeroBase.js"); /** * Change last argument dim from one-based to zero-based. */ function lastDimToZeroBase(args) { if (args.length === 2 && (0, _is.isCollection)(args[0])) { args = args.slice(); const dim = args[1]; if ((0, _dimToZeroBase.isNumberOrBigNumber)(dim)) { args[1] = (0, _dimToZeroBase.dimToZeroBase)(dim); } } return args; }