UNPKG

@stdlib/esm

Version:

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

3 lines 1.16 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-number.js";import n from"./../math/base/assert/is-nan.js";import t from"./../assert/is-nonnegative-integer.js";import i from"./../symbol/iterator.js";var o=e,a=r.isPrimitive,u=n,m=t.isPrimitive,s=i;function l(e,r,n){var t,i,f,d,v,g,p;if(!a(e)||u(e))throw new TypeError("invalid argument. First argument must be a number. Value: `"+e+"`.");if(!a(r)||u(r))throw new TypeError("invalid argument. Second argument must be a number. Value: `"+r+"`.");if(arguments.length>2){if(!m(n))throw new TypeError("invalid argument. Third argument must be a nonnegative integer. Value: `"+n+"`.");v=n}else v=100;return i=(t=r-e)/(g=v-1),p=-1,o(f={},"next",b),o(f,"return",h),s&&o(f,s,w),f;function b(){return p+=1,d||p>=v?{done:!0}:0===p?{value:e,done:!1}:p===g?{value:r,done:!1}:{value:0===i?p/g*t+e:p*i+e,done:!1}}function h(e){return d=!0,arguments.length?{value:e,done:!0}:{done:!0}}function w(){return l(e,r,v)}}var f=l;export default f; //# sourceMappingURL=linspace.js.map