a zip code crypto-currency system good for red ONLY

12345678910111213141516171819
  1. "use strict";
  2. var toPosInt = require("../number/to-pos-integer")
  3. , value = require("../object/valid-value")
  4. , slice = Array.prototype.slice;
  5. module.exports = function (length /*, …fill*/) {
  6. var arr, currentLength;
  7. length = toPosInt(value(length));
  8. if (length === 0) return [];
  9. arr = arguments.length < 2 ? [undefined] : slice.call(arguments, 1, 1 + length);
  10. while ((currentLength = arr.length) < length) {
  11. arr = arr.concat(arr.slice(0, length - currentLength));
  12. }
  13. return arr;
  14. };