Source

math/getStepsToTotal.js

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
 * Get an array of number,
 * which is the total number divided by a step number.
 *
 * @param total
 * @param step
 * @category math
 * @module getStepsToTotal
 */
var getStepsToTotal = function (total, step) {
    var numSteps = Math.floor(total / step) + (total % step ? 1 : 0);
    var steps = Array(numSteps).fill(0)
        .map(function (v, index) { return index * step; }, []);
    return steps;
};
exports.default = getStepsToTotal;