@stdlib/esm
Version:
ES module distribution for Stdlib, a standard library for JavaScript and Node.js.
3 lines • 2.46 kB
JavaScript
// 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 t from"./../../utils/define-nonenumerable-read-only-accessor.js";import r from"./../../utils/define-nonenumerable-read-write-accessor.js";import n from"./../../utils/constant-function.js";import i from"./../../utils/noop.js";import o from"./../../utils/copy.js";import s from"./../../assert/is-positive-number.js";import a from"./../../assert/is-plain-object.js";import u from"./../../assert/is-number.js";import m from"./../../math/base/assert/is-nan.js";import f from"./../../assert/is-nonnegative-integer.js";import l from"./../../assert/has-own-property.js";import p from"./../../constants/math/float64-max.js";import d from"./../base/frechet.js";import g from"./../../symbol/iterator.js";var c=e,b=t,h=r,v=n,j=i,y=o,w=s.isPrimitive,P=a,L=u.isPrimitive,G=m,N=f.isPrimitive,R=l,T=p,E=d.factory,V=g;function x(e,t,r,n){var i,o,s,a,u;if(!w(e))throw new TypeError("invalid argument. First argument must be a positive number. Value: `"+e+"`.");if(!w(t))throw new TypeError("invalid argument. Second argument must be a positive number. Value: `"+t+"`.");if(!L(r)||G(r))throw new TypeError("invalid argument. Third argument must be a number primitive. Value: `"+r+"`.");if(arguments.length>3){if(!P(n))throw new TypeError("invalid argument. Options argument must be an object. Value: `"+n+"`.");if(i=y(n,1),R(i,"iter")){if(!N(i.iter))throw new TypeError("invalid option. `iter` option must be a nonnegative integer. Option: `"+i.iter+"`.")}else i.iter=T;s=E(e,t,r,i),void 0===i.prng&&!1!==i.copy&&(i.state=s.state)}else s=E(e,t,r),i={iter:T,state:s.state};return u=0,c(o={},"next",m),c(o,"return",f),i&&i.prng?(c(o,"seed",null),c(o,"seedLength",null),h(o,"state",v(null),j),c(o,"stateLength",null),c(o,"byteLength",null)):(b(o,"seed",p),b(o,"seedLength",d),h(o,"state",F,S),b(o,"stateLength",g),b(o,"byteLength",O)),c(o,"PRNG",s.PRNG),V&&c(o,V,l),o;function m(){return u+=1,a||u>i.iter?{done:!0}:{value:s(),done:!1}}function f(e){return a=!0,arguments.length?{value:e,done:!0}:{done:!0}}function l(){return x(e,t,r,i)}function p(){return s.PRNG.seed}function d(){return s.PRNG.seedLength}function g(){return s.PRNG.stateLength}function O(){return s.PRNG.byteLength}function F(){return s.PRNG.state}function S(e){s.PRNG.state=e}}var O=x;export default O;
//# sourceMappingURL=frechet.js.map