-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
19 lines (19 loc) · 3.95 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
"use strict";var w=function(t,e){return function(){return e||t((e={exports:{}}).exports,e),e.exports}};var h=w(function(C,m){"use strict";var c=require("@stdlib/array-base-assert-is-complex-floating-point-data-type"),b=require("@stdlib/array-base-assert-is-boolean-data-type"),q=require("@stdlib/assert-is-string").isPrimitive,g=require("@stdlib/assert-is-nonnegative-integer").isPrimitive,y=require("@stdlib/assert-is-collection"),v=require("@stdlib/assert-is-arraybuffer"),f=require("@stdlib/assert-is-object"),u=require("@stdlib/assert-is-function"),E=require("@stdlib/array-ctors"),p=require("@stdlib/blas-ext-base-gfill"),T=require("@stdlib/array-base-filled"),k=require("@stdlib/strided-base-reinterpret-boolean"),M=require("@stdlib/assert-has-iterator-symbol-support"),s=require("@stdlib/symbol-iterator"),j=require("@stdlib/iter-length"),V=require("@stdlib/array-defaults"),l=require("@stdlib/string-format"),d=M(),A=V.get("dtypes.default");function S(t,e){var a,n;for(a=[];n=t.next(),!n.done;)a.push(e);return a}function B(t,e){var a;for(a=0;a<t.length;a++)t.set(e,a);return t}function x(){var t,e,a,n,i,o,r;if(e=arguments.length,e-=1,e>=0&&q(arguments[e])?(a=arguments[e],e-=1):a=A,n=E(a),n===null)throw new TypeError(l("invalid argument. Must provide a recognized data type. Value: `%s`.",a));if(a==="generic"){if(e<=0)return[];if(t=arguments[0],r=arguments[1],e===1){if(g(r)?o=r:y(r)&&(o=r.length),o!==void 0)return T(t,o);if(v(r))throw new Error("invalid arguments. Creating a generic array from an ArrayBuffer is not supported.");if(f(r)){if(d===!1)throw new TypeError(l("invalid argument. Environment lacks Symbol.iterator support. Must provide a length, typed array, or array-like object. Value: `%s`.",r));if(!u(r[s]))throw new TypeError(l("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",r));if(r=r[s](),!u(r.next))throw new TypeError(l("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",r));return S(r,t)}throw new TypeError(l("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",r))}else if(v(r))throw new Error("invalid arguments. Creating a generic array from an ArrayBuffer is not supported.");throw new TypeError(l("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",r))}if(e<=0)return new n(0);if(e===1)if(r=arguments[1],y(r))i=new n(r.length);else if(v(r))i=new n(r);else if(g(r))i=new n(r);else if(f(r)){if(d===!1)throw new TypeError(l("invalid argument. Environment lacks Symbol.iterator support. Must provide a length, typed array, or array-like object. Value: `%s`.",r));if(!u(r[s]))throw new TypeError(l("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",r));if(r=r[s](),!u(r.next))throw new TypeError(l("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",r));i=new n(j(r))}else throw new TypeError(l("invalid argument. Must provide a length, typed array, array-like object, or an iterable. Value: `%s`.",r));else e===2?i=new n(arguments[1],arguments[2]):i=new n(arguments[1],arguments[2],arguments[3]);return i.length>0&&(t=arguments[0],c(a)?B(i,t):b(a)?p(i.length,t?1:0,k(i,0),1):p(i.length,t,i,1)),i}m.exports=x});var I=h();module.exports=I;
/**
* @license Apache-2.0
*
* Copyright (c) 2020 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
//# sourceMappingURL=index.js.map