@stdlib/esm
Version:
ES module distribution for Stdlib, a standard library for JavaScript and Node.js.
3 lines • 1.83 kB
JavaScript
// This file is a part of stdlib. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0
import r from"./../../../utils/define-nonenumerable-read-only-property.js";import e from"./../../../assert/is-function.js";import n from"./../../../assert/is-iterator-like.js";import t from"./../../../assert/is-number.js";import o from"./../../../assert/has-own-property.js";import i from"./../../../symbol/iterator.js";import a from"./../../../assert/is-plain-object.js";var u=a,l=o;function s(r,e){return u(e)?(l(e,"invalid")&&(r.invalid=e.invalid),null):new TypeError("invalid argument. Options argument must be an object. Value: `"+e+"`.")}var f=r,m=e,p=n,v=t.isPrimitive,d=o,c=i,h=s;function b(r,e,n,t){var o,i,a,u,l,s,j,y,g;for(u=2,i=[0,0],o=[],a=[],g=0;g<u;g++)if(o.push(arguments[g]),p(arguments[g]))a.push(1);else{if(!v(arguments[g]))throw new TypeError("invalid argument. Must provide an iterator protocol-compliant object or a number. Argument: `"+g+"`. Value: `"+arguments[g]+"`.");a.push(0)}if(!m(n))throw new TypeError("invalid argument. Third argument must be a function. Value: `"+n+"`.");if(s={invalid:NaN},arguments.length>3&&(y=h(s,t)))throw y;if(f(l={},"next",w),f(l,"return",T),c){for(g=0;g<u;g++)if(a[g]&&!m(o[g][c])){j=!0;break}j||f(l,c,x)}return j=0,l;function w(){var r,e,t;if(j)return{done:!0};for(j=0,r=0,t=0;t<u;t++)if(a[t]){if((e=o[t].next()).done){if(j+=1,d(e,"value")){"number"==typeof e.value?i[t]=e.value:r=1;continue}return{done:!0}}"number"==typeof e.value?i[t]=e.value:r=1}else i[t]=o[t];return r?{value:s.invalid,done:!1}:{value:n(i[0],i[1]),done:!1}}function T(r){return j=1,arguments.length?{value:r,done:!0}:{done:!0}}function x(){var r,e;for(r=[],e=0;e<u;e++)a[e]?r.push(o[e][c]()):r.push(o[e]);return r.push(n,s),b.apply(null,r)}}var j=b;export default j;
//# sourceMappingURL=map2.js.map