UNPKG

@stdlib/esm

Version:

ES module distribution for Stdlib, a standard library for JavaScript and Node.js.

3 lines 1.44 kB
// This file is a part of stdlib. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 import e from"./../utils/define-nonenumerable-read-only-property.js";import r from"./../assert/is-nonnegative-integer.js";import t from"./../assert/is-function.js";import n from"./../assert/is-iterator-like.js";import o from"./../assert/has-own-property.js";import i from"./../symbol/iterator.js";var a=e,u=r.isPrimitive,s=t,l=n,m=o,f=i,v=0,p=1e308;function g(e,r,t,n){var o,i,d,h,c;if(!l(e))throw new TypeError("invalid argument. First argument must be an iterator protocol-compliant object. Value: `"+e+"`.");if(arguments.length>2){if(!u(t))throw new TypeError("invalid argument. Third argument must be a nonnegative integer. Value: `"+t+"`.");if(d=t,arguments.length>3){if(!u(n))throw new TypeError("invalid argument. Fourth argument must be a nonnegative integer. Value: `"+n+"`.");h=n}else h=p}else{if(arguments.length<2)throw new Error("insufficient input arguments. Must provide both an iterator and a static value.");d=v,h=p}return a(o={},"next",w),a(o,"return",b),f&&s(e[f])&&a(o,f,j),c=-1,o;function w(){var t,n;return i?{done:!0}:(n=e.next(),c+=1,n.done?(i=!0,t={},m(n,"value")&&(t.value=c>=d&&c<h?r:n.value),t.done=!0,t):{value:c>=d&&c<h?r:n.value,done:!1})}function b(e){return i=!0,arguments.length?{value:e,done:!0}:{done:!0}}function j(){return g(e[f](),r,d,h)}}var d=g;export default d; //# sourceMappingURL=fill.js.map