-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathreplicate.js
1 lines (1 loc) · 1011 Bytes
/
replicate.js
1
(function(a,b){if("function"==typeof define&&define.amd)define(["exports","./commons/ErrorModels","./commons/Iterators","./commons/utility"],b);else if("undefined"!=typeof exports)b(exports,require("./commons/ErrorModels"),require("./commons/Iterators"),require("./commons/utility"));else{var c={exports:{}};b(c.exports,a.commonsErrorModels,a.commonsIterators,a.commonsUtility),a.replicate=c.exports}})(this,function(a,b,c,d){"use strict";function e(a,b){return"number"!=typeof a||"number"!=typeof b&&"string"!=typeof b&&"function"!=typeof b&&!(0,d.isIterator)(b)}function f(a){return 1>a}Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;a.default=function(a,g){if(e(a,g))throw new b.ArgumentError("Please check arguments type.");if(f(a))throw new b.ArgumentError("Replicate count must be larger than 1.");if((0,d.isRepeatIterator)(g))throw new b.ArgumentError("Do not use infinite type iterator.");var h=g;return(0,d.isIterator)(g)||(h=new c.PrimitiveIterator(g)),new c.RepeatIterator(h,a)}});