@math.gl/types 3.6.3 → 4.0.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,15 @@
1
+ /**
2
+ * TypeScript type covering all typed arrays
3
+ */
4
+ export declare type TypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array;
5
+ export declare type TypedArrayConstructor = Int8ArrayConstructor | Uint8ArrayConstructor | Uint8ClampedArrayConstructor | Int16ArrayConstructor | Uint16ArrayConstructor | Int32ArrayConstructor | Uint32ArrayConstructor | Float32ArrayConstructor | Float64ArrayConstructor;
6
+ /**
7
+ * TypeScript type covering all typed arrays and classic arrays consisting of numbers
8
+ */
9
+ export declare type NumericArray = TypedArray | number[];
10
+ /**
11
+ * TypeScript type covering all typed arrays and classic arrays consisting of numbers
12
+ * @note alias for NumericArray
13
+ */
14
+ export declare type NumberArray = NumericArray;
15
+ //# sourceMappingURL=array-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"array-types.d.ts","sourceRoot":"","sources":["../src/array-types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,UAAU,GAClB,SAAS,GACT,UAAU,GACV,iBAAiB,GACjB,UAAU,GACV,WAAW,GACX,UAAU,GACV,WAAW,GACX,YAAY,GACZ,YAAY,CAAC;AAMjB,oBAAY,qBAAqB,GAC7B,oBAAoB,GACpB,qBAAqB,GACrB,4BAA4B,GAC5B,qBAAqB,GACrB,sBAAsB,GACtB,qBAAqB,GACrB,sBAAsB,GACtB,uBAAuB,GACvB,uBAAuB,CAAC;AAE5B;;GAEG;AACH,oBAAY,YAAY,GAAG,UAAU,GAAG,MAAM,EAAE,CAAC;AAEjD;;;GAGG;AACH,oBAAY,WAAW,GAAG,YAAY,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=array-types.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"number-array.js"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"array-types.js"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/bigint.ts"],"names":["ERR_BIGINT_UNAVAILABLE","BigIntUnavailable","Error","asIntN","asUintN","BigInt64ArrayUnavailable","BYTES_PER_ELEMENT","of","from","constructor","BigIntAvailable","BigInt","BigInt64ArrayAvailable","BigInt64Array","BigUint64ArrayAvailable","BigUint64Array","BigIntCtor","BigInt64ArrayCtor","BigUint64ArrayCtor"],"mappings":"AAMA,MAAMA,sBAAsB,GAAG,6CAA/B;;AAEA,SAASC,iBAAT,GAA6B;AAC3B,QAAM,IAAIC,KAAJ,CAAUF,sBAAV,CAAN;AACD;;AACDC,iBAAiB,CAACE,MAAlB,GAA2B,MAAM;AAC/B,QAAM,IAAID,KAAJ,CAAUF,sBAAV,CAAN;AACD,CAFD;;AAGAC,iBAAiB,CAACG,OAAlB,GAA4B,MAAM;AAChC,QAAM,IAAIF,KAAJ,CAAUF,sBAAV,CAAN;AACD,CAFD;;AAIA,MAAMK,wBAAN,CAA+B;AACD,aAAjBC,iBAAiB,GAAG;AAC7B,WAAO,CAAP;AACD;;AACQ,SAAFC,EAAE,GAAG;AACV,UAAM,IAAIL,KAAJ,CAAUF,sBAAV,CAAN;AACD;;AACU,SAAJQ,IAAI,GAAG;AACZ,UAAM,IAAIN,KAAJ,CAAUF,sBAAV,CAAN;AACD;;AACDS,EAAAA,WAAW,GAAG;AACZ,UAAM,IAAIP,KAAJ,CAAUF,sBAAV,CAAN;AACD;;AAZ4B;;AAe/B,OAAO,MAAMU,eAAe,GAAG,OAAOC,MAAP,KAAkB,WAA1C;AACP,OAAO,MAAMC,sBAAsB,GAAG,OAAOC,aAAP,KAAyB,WAAxD;AACP,OAAO,MAAMC,uBAAuB,GAAG,OAAOC,cAAP,KAA0B,WAA1D;;AAEP,MAAMC,UAAU,GAAG,CAAC,MAAM;AACxB,SAAON,eAAe,GAAGC,MAAH,GAAYV,iBAAlC;AACD,CAFkB,GAAnB;;AAIA,MAAMgB,iBAAiB,GAAG,CAAC,MAAM;AAC/B,SAAOL,sBAAsB,GAAGC,aAAH,GAAmBR,wBAAhD;AACD,CAFyB,GAA1B;;AAIA,MAAMa,kBAAkB,GAAG,CAAC,MAAM;AAChC,SAAOJ,uBAAuB,GAAG,CAACC,cAAD,CAAH,GAAsB,CAACV,wBAAD,CAApD;AACD,CAF0B,GAA3B;;AAIA,SAAQW,UAAU,IAAIL,MAAtB;AACA,SAAQM,iBAAiB,IAAIJ,aAA7B;AACA,SAAQK,kBAAkB,IAAIH,cAA9B","sourcesContent":["// BigInt compatibility layer\n// Inspired by ArrowJS (under Apache2 license)\n// https://github.com/apache/arrow/blob/master/js/src/util/compat.ts\n// Requires tsconfig.json: target=esnext or (lib: esnext.bigint)\n// Requires eslint: env: {es2020: true}\n\nconst ERR_BIGINT_UNAVAILABLE = 'BigInt is not available in this environment';\n\nfunction BigIntUnavailable() {\n throw new Error(ERR_BIGINT_UNAVAILABLE);\n}\nBigIntUnavailable.asIntN = () => {\n throw new Error(ERR_BIGINT_UNAVAILABLE);\n};\nBigIntUnavailable.asUintN = () => {\n throw new Error(ERR_BIGINT_UNAVAILABLE);\n};\n\nclass BigInt64ArrayUnavailable {\n static get BYTES_PER_ELEMENT() {\n return 8;\n }\n static of() {\n throw new Error(ERR_BIGINT_UNAVAILABLE);\n }\n static from() {\n throw new Error(ERR_BIGINT_UNAVAILABLE);\n }\n constructor() {\n throw new Error(ERR_BIGINT_UNAVAILABLE);\n }\n}\n\nexport const BigIntAvailable = typeof BigInt !== 'undefined';\nexport const BigInt64ArrayAvailable = typeof BigInt64Array !== 'undefined';\nexport const BigUint64ArrayAvailable = typeof BigUint64Array !== 'undefined';\n\nconst BigIntCtor = (() => {\n return BigIntAvailable ? BigInt : BigIntUnavailable;\n})();\n\nconst BigInt64ArrayCtor = (() => {\n return BigInt64ArrayAvailable ? BigInt64Array : BigInt64ArrayUnavailable;\n})();\n\nconst BigUint64ArrayCtor = (() => {\n return BigUint64ArrayAvailable ? [BigUint64Array] : [BigInt64ArrayUnavailable];\n})();\n\nexport {BigIntCtor as BigInt};\nexport {BigInt64ArrayCtor as BigInt64Array};\nexport {BigUint64ArrayCtor as BigUint64Array};\n"],"file":"bigint.js"}
package/dist/index.cjs ADDED
@@ -0,0 +1,36 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/index.ts
20
+ var src_exports = {};
21
+ __export(src_exports, {
22
+ isNumericArray: () => isNumericArray,
23
+ isTypedArray: () => isTypedArray
24
+ });
25
+ module.exports = __toCommonJS(src_exports);
26
+
27
+ // src/is-array.ts
28
+ function isTypedArray(value) {
29
+ return ArrayBuffer.isView(value) && !(value instanceof DataView) ? value : null;
30
+ }
31
+ function isNumericArray(value) {
32
+ if (Array.isArray(value)) {
33
+ return value.length === 0 || typeof value[0] === "number" ? value : null;
34
+ }
35
+ return isTypedArray(value);
36
+ }
package/dist/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
- export { TypedArray, NumberArray, NumericArray } from './number-array';
1
+ export type { TypedArray, TypedArrayConstructor, NumericArray, NumberArray } from './array-types';
2
+ export { isTypedArray, isNumericArray } from './is-array';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,WAAW,EAAE,YAAY,EAAC,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAC,UAAU,EAAE,qBAAqB,EAAE,YAAY,EAAE,WAAW,EAAC,MAAM,eAAe,CAAC;AAChG,OAAO,EAAC,YAAY,EAAE,cAAc,EAAC,MAAM,YAAY,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ export { isTypedArray, isNumericArray } from "./is-array.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"names":["isTypedArray","isNumericArray"],"mappings":"SACQA,Y,EAAcC,c","sourcesContent":["export type {TypedArray, TypedArrayConstructor, NumericArray, NumberArray} from './array-types';\nexport {isTypedArray, isNumericArray} from './is-array';\n"],"file":"index.js"}
@@ -0,0 +1,14 @@
1
+ import { TypedArray, NumericArray } from './array-types';
2
+ /**
3
+ * Check is an array is a typed array
4
+ * @param value value to be tested
5
+ * @returns input as TypedArray, or null
6
+ */
7
+ export declare function isTypedArray(value: unknown): TypedArray | null;
8
+ /**
9
+ * Check is an array is a numeric array (typed array or array of numbers)
10
+ * @param value value to be tested
11
+ * @returns input as NumericArray, or null
12
+ */
13
+ export declare function isNumericArray(value: unknown): NumericArray | null;
14
+ //# sourceMappingURL=is-array.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-array.d.ts","sourceRoot":"","sources":["../src/is-array.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,YAAY,EAAC,MAAM,eAAe,CAAC;AAEvD;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,UAAU,GAAG,IAAI,CAE9D;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,YAAY,GAAG,IAAI,CAKlE"}
@@ -0,0 +1,11 @@
1
+ export function isTypedArray(value) {
2
+ return ArrayBuffer.isView(value) && !(value instanceof DataView) ? value : null;
3
+ }
4
+ export function isNumericArray(value) {
5
+ if (Array.isArray(value)) {
6
+ return value.length === 0 || typeof value[0] === 'number' ? value : null;
7
+ }
8
+
9
+ return isTypedArray(value);
10
+ }
11
+ //# sourceMappingURL=is-array.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/is-array.ts"],"names":["isTypedArray","value","ArrayBuffer","isView","DataView","isNumericArray","Array","isArray","length"],"mappings":"AAOA,OAAO,SAASA,YAAT,CAAsBC,KAAtB,EAAyD;AAC9D,SAAOC,WAAW,CAACC,MAAZ,CAAmBF,KAAnB,KAA6B,EAAEA,KAAK,YAAYG,QAAnB,CAA7B,GAA6DH,KAA7D,GAAoF,IAA3F;AACD;AAOD,OAAO,SAASI,cAAT,CAAwBJ,KAAxB,EAA6D;AAClE,MAAIK,KAAK,CAACC,OAAN,CAAcN,KAAd,CAAJ,EAA0B;AACxB,WAAOA,KAAK,CAACO,MAAN,KAAiB,CAAjB,IAAsB,OAAOP,KAAK,CAAC,CAAD,CAAZ,KAAoB,QAA1C,GAAsDA,KAAtD,GAA2E,IAAlF;AACD;;AACD,SAAOD,YAAY,CAACC,KAAD,CAAnB;AACD","sourcesContent":["import {TypedArray, NumericArray} from './array-types';\n\n/**\n * Check is an array is a typed array\n * @param value value to be tested\n * @returns input as TypedArray, or null\n */\nexport function isTypedArray(value: unknown): TypedArray | null {\n return ArrayBuffer.isView(value) && !(value instanceof DataView) ? (value as TypedArray) : null;\n}\n\n/**\n * Check is an array is a numeric array (typed array or array of numbers)\n * @param value value to be tested\n * @returns input as NumericArray, or null\n */\nexport function isNumericArray(value: unknown): NumericArray | null {\n if (Array.isArray(value)) {\n return value.length === 0 || typeof value[0] === 'number' ? (value as number[]) : null;\n }\n return isTypedArray(value);\n}\n"],"file":"is-array.js"}
package/package.json CHANGED
@@ -2,10 +2,11 @@
2
2
  "name": "@math.gl/types",
3
3
  "description": "TypeScript types for math.gl",
4
4
  "license": "MIT",
5
+ "type": "module",
5
6
  "publishConfig": {
6
7
  "access": "public"
7
8
  },
8
- "version": "3.6.3",
9
+ "version": "4.0.0-alpha.2",
9
10
  "keywords": [
10
11
  "typescript",
11
12
  "javascript",
@@ -18,8 +19,8 @@
18
19
  "url": "https://github.com/uber-web/math.gl.git"
19
20
  },
20
21
  "types": "dist/index.d.ts",
21
- "main": "dist/es5/index.js",
22
- "module": "dist/esm/index.js",
22
+ "main": "dist/index.cjs",
23
+ "module": "dist/index.js",
23
24
  "files": [
24
25
  "dist",
25
26
  "src"
@@ -27,5 +28,5 @@
27
28
  "sideEffects": [
28
29
  "./src/bigint.js"
29
30
  ],
30
- "gitHead": "0efab394df9babad7ed93027c1003f30528b2090"
31
+ "gitHead": "2e693639e3cf898fee8e323c93efdd07be7c2ca7"
31
32
  }
@@ -4,11 +4,11 @@
4
4
  export type TypedArray =
5
5
  | Int8Array
6
6
  | Uint8Array
7
+ | Uint8ClampedArray
7
8
  | Int16Array
8
9
  | Uint16Array
9
10
  | Int32Array
10
11
  | Uint32Array
11
- | Uint8ClampedArray
12
12
  | Float32Array
13
13
  | Float64Array;
14
14
 
@@ -16,6 +16,17 @@ export type TypedArray =
16
16
  // | BigInt64Array
17
17
  // | BigUint64Array;
18
18
 
19
+ export type TypedArrayConstructor =
20
+ | Int8ArrayConstructor
21
+ | Uint8ArrayConstructor
22
+ | Uint8ClampedArrayConstructor
23
+ | Int16ArrayConstructor
24
+ | Uint16ArrayConstructor
25
+ | Int32ArrayConstructor
26
+ | Uint32ArrayConstructor
27
+ | Float32ArrayConstructor
28
+ | Float64ArrayConstructor;
29
+
19
30
  /**
20
31
  * TypeScript type covering all typed arrays and classic arrays consisting of numbers
21
32
  */
@@ -23,5 +34,6 @@ export type NumericArray = TypedArray | number[];
23
34
 
24
35
  /**
25
36
  * TypeScript type covering all typed arrays and classic arrays consisting of numbers
37
+ * @note alias for NumericArray
26
38
  */
27
- export type NumberArray = TypedArray | number[];
39
+ export type NumberArray = NumericArray;
package/src/index.ts CHANGED
@@ -1 +1,2 @@
1
- export {TypedArray, NumberArray, NumericArray} from './number-array';
1
+ export type {TypedArray, TypedArrayConstructor, NumericArray, NumberArray} from './array-types';
2
+ export {isTypedArray, isNumericArray} from './is-array';
@@ -0,0 +1,22 @@
1
+ import {TypedArray, NumericArray} from './array-types';
2
+
3
+ /**
4
+ * Check is an array is a typed array
5
+ * @param value value to be tested
6
+ * @returns input as TypedArray, or null
7
+ */
8
+ export function isTypedArray(value: unknown): TypedArray | null {
9
+ return ArrayBuffer.isView(value) && !(value instanceof DataView) ? (value as TypedArray) : null;
10
+ }
11
+
12
+ /**
13
+ * Check is an array is a numeric array (typed array or array of numbers)
14
+ * @param value value to be tested
15
+ * @returns input as NumericArray, or null
16
+ */
17
+ export function isNumericArray(value: unknown): NumericArray | null {
18
+ if (Array.isArray(value)) {
19
+ return value.length === 0 || typeof value[0] === 'number' ? (value as number[]) : null;
20
+ }
21
+ return isTypedArray(value);
22
+ }
@@ -1,77 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.BigUint64Array = exports.BigInt64Array = exports.BigInt = exports.BigUint64ArrayAvailable = exports.BigInt64ArrayAvailable = exports.BigIntAvailable = void 0;
9
-
10
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
11
-
12
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
13
-
14
- var ERR_BIGINT_UNAVAILABLE = 'BigInt is not available in this environment';
15
-
16
- function BigIntUnavailable() {
17
- throw new Error(ERR_BIGINT_UNAVAILABLE);
18
- }
19
-
20
- BigIntUnavailable.asIntN = function () {
21
- throw new Error(ERR_BIGINT_UNAVAILABLE);
22
- };
23
-
24
- BigIntUnavailable.asUintN = function () {
25
- throw new Error(ERR_BIGINT_UNAVAILABLE);
26
- };
27
-
28
- var BigInt64ArrayUnavailable = function () {
29
- function BigInt64ArrayUnavailable() {
30
- (0, _classCallCheck2.default)(this, BigInt64ArrayUnavailable);
31
- throw new Error(ERR_BIGINT_UNAVAILABLE);
32
- }
33
-
34
- (0, _createClass2.default)(BigInt64ArrayUnavailable, null, [{
35
- key: "BYTES_PER_ELEMENT",
36
- get: function get() {
37
- return 8;
38
- }
39
- }, {
40
- key: "of",
41
- value: function of() {
42
- throw new Error(ERR_BIGINT_UNAVAILABLE);
43
- }
44
- }, {
45
- key: "from",
46
- value: function from() {
47
- throw new Error(ERR_BIGINT_UNAVAILABLE);
48
- }
49
- }]);
50
- return BigInt64ArrayUnavailable;
51
- }();
52
-
53
- var BigIntAvailable = typeof BigInt !== 'undefined';
54
- exports.BigIntAvailable = BigIntAvailable;
55
- var BigInt64ArrayAvailable = typeof BigInt64Array !== 'undefined';
56
- exports.BigInt64ArrayAvailable = BigInt64ArrayAvailable;
57
- var BigUint64ArrayAvailable = typeof BigUint64Array !== 'undefined';
58
- exports.BigUint64ArrayAvailable = BigUint64ArrayAvailable;
59
-
60
- var BigIntCtor = function () {
61
- return BigIntAvailable ? BigInt : BigIntUnavailable;
62
- }();
63
-
64
- exports.BigInt = BigIntCtor;
65
-
66
- var BigInt64ArrayCtor = function () {
67
- return BigInt64ArrayAvailable ? BigInt64Array : BigInt64ArrayUnavailable;
68
- }();
69
-
70
- exports.BigInt64Array = BigInt64ArrayCtor;
71
-
72
- var BigUint64ArrayCtor = function () {
73
- return BigUint64ArrayAvailable ? [BigUint64Array] : [BigInt64ArrayUnavailable];
74
- }();
75
-
76
- exports.BigUint64Array = BigUint64ArrayCtor;
77
- //# sourceMappingURL=bigint.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/bigint.ts"],"names":["ERR_BIGINT_UNAVAILABLE","BigIntUnavailable","Error","asIntN","asUintN","BigInt64ArrayUnavailable","BigIntAvailable","BigInt","BigInt64ArrayAvailable","BigInt64Array","BigUint64ArrayAvailable","BigUint64Array","BigIntCtor","BigInt64ArrayCtor","BigUint64ArrayCtor"],"mappings":";;;;;;;;;;;;;AAMA,IAAMA,sBAAsB,GAAG,6CAA/B;;AAEA,SAASC,iBAAT,GAA6B;AAC3B,QAAM,IAAIC,KAAJ,CAAUF,sBAAV,CAAN;AACD;;AACDC,iBAAiB,CAACE,MAAlB,GAA2B,YAAM;AAC/B,QAAM,IAAID,KAAJ,CAAUF,sBAAV,CAAN;AACD,CAFD;;AAGAC,iBAAiB,CAACG,OAAlB,GAA4B,YAAM;AAChC,QAAM,IAAIF,KAAJ,CAAUF,sBAAV,CAAN;AACD,CAFD;;IAIMK,wB;AAUJ,sCAAc;AAAA;AACZ,UAAM,IAAIH,KAAJ,CAAUF,sBAAV,CAAN;AACD;;;;SAXD,eAA+B;AAC7B,aAAO,CAAP;AACD;;;WACD,cAAY;AACV,YAAM,IAAIE,KAAJ,CAAUF,sBAAV,CAAN;AACD;;;WACD,gBAAc;AACZ,YAAM,IAAIE,KAAJ,CAAUF,sBAAV,CAAN;AACD;;;;;AAMI,IAAMM,eAAe,GAAG,OAAOC,MAAP,KAAkB,WAA1C;;AACA,IAAMC,sBAAsB,GAAG,OAAOC,aAAP,KAAyB,WAAxD;;AACA,IAAMC,uBAAuB,GAAG,OAAOC,cAAP,KAA0B,WAA1D;;;AAEP,IAAMC,UAAU,GAAI,YAAM;AACxB,SAAON,eAAe,GAAGC,MAAH,GAAYN,iBAAlC;AACD,CAFkB,EAAnB;;;;AAIA,IAAMY,iBAAiB,GAAI,YAAM;AAC/B,SAAOL,sBAAsB,GAAGC,aAAH,GAAmBJ,wBAAhD;AACD,CAFyB,EAA1B;;;;AAIA,IAAMS,kBAAkB,GAAI,YAAM;AAChC,SAAOJ,uBAAuB,GAAG,CAACC,cAAD,CAAH,GAAsB,CAACN,wBAAD,CAApD;AACD,CAF0B,EAA3B","sourcesContent":["// BigInt compatibility layer\n// Inspired by ArrowJS (under Apache2 license)\n// https://github.com/apache/arrow/blob/master/js/src/util/compat.ts\n// Requires tsconfig.json: target=esnext or (lib: esnext.bigint)\n// Requires eslint: env: {es2020: true}\n\nconst ERR_BIGINT_UNAVAILABLE = 'BigInt is not available in this environment';\n\nfunction BigIntUnavailable() {\n throw new Error(ERR_BIGINT_UNAVAILABLE);\n}\nBigIntUnavailable.asIntN = () => {\n throw new Error(ERR_BIGINT_UNAVAILABLE);\n};\nBigIntUnavailable.asUintN = () => {\n throw new Error(ERR_BIGINT_UNAVAILABLE);\n};\n\nclass BigInt64ArrayUnavailable {\n static get BYTES_PER_ELEMENT() {\n return 8;\n }\n static of() {\n throw new Error(ERR_BIGINT_UNAVAILABLE);\n }\n static from() {\n throw new Error(ERR_BIGINT_UNAVAILABLE);\n }\n constructor() {\n throw new Error(ERR_BIGINT_UNAVAILABLE);\n }\n}\n\nexport const BigIntAvailable = typeof BigInt !== 'undefined';\nexport const BigInt64ArrayAvailable = typeof BigInt64Array !== 'undefined';\nexport const BigUint64ArrayAvailable = typeof BigUint64Array !== 'undefined';\n\nconst BigIntCtor = (() => {\n return BigIntAvailable ? BigInt : BigIntUnavailable;\n})();\n\nconst BigInt64ArrayCtor = (() => {\n return BigInt64ArrayAvailable ? BigInt64Array : BigInt64ArrayUnavailable;\n})();\n\nconst BigUint64ArrayCtor = (() => {\n return BigUint64ArrayAvailable ? [BigUint64Array] : [BigInt64ArrayUnavailable];\n})();\n\nexport {BigIntCtor as BigInt};\nexport {BigInt64ArrayCtor as BigInt64Array};\nexport {BigUint64ArrayCtor as BigUint64Array};\n"],"file":"bigint.js"}
package/dist/es5/index.js DELETED
@@ -1,26 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "TypedArray", {
7
- enumerable: true,
8
- get: function get() {
9
- return _numberArray.TypedArray;
10
- }
11
- });
12
- Object.defineProperty(exports, "NumberArray", {
13
- enumerable: true,
14
- get: function get() {
15
- return _numberArray.NumberArray;
16
- }
17
- });
18
- Object.defineProperty(exports, "NumericArray", {
19
- enumerable: true,
20
- get: function get() {
21
- return _numberArray.NumericArray;
22
- }
23
- });
24
-
25
- var _numberArray = require("./number-array");
26
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA","sourcesContent":["export {TypedArray, NumberArray, NumericArray} from './number-array';\n"],"file":"index.js"}
@@ -1,2 +0,0 @@
1
- "use strict";
2
- //# sourceMappingURL=number-array.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/bigint.ts"],"names":["ERR_BIGINT_UNAVAILABLE","BigIntUnavailable","Error","asIntN","asUintN","BigInt64ArrayUnavailable","BYTES_PER_ELEMENT","of","from","constructor","BigIntAvailable","BigInt","BigInt64ArrayAvailable","BigInt64Array","BigUint64ArrayAvailable","BigUint64Array","BigIntCtor","BigInt64ArrayCtor","BigUint64ArrayCtor"],"mappings":"AAMA,MAAMA,sBAAsB,GAAG,6CAA/B;;AAEA,SAASC,iBAAT,GAA6B;AAC3B,QAAM,IAAIC,KAAJ,CAAUF,sBAAV,CAAN;AACD;;AACDC,iBAAiB,CAACE,MAAlB,GAA2B,MAAM;AAC/B,QAAM,IAAID,KAAJ,CAAUF,sBAAV,CAAN;AACD,CAFD;;AAGAC,iBAAiB,CAACG,OAAlB,GAA4B,MAAM;AAChC,QAAM,IAAIF,KAAJ,CAAUF,sBAAV,CAAN;AACD,CAFD;;AAIA,MAAMK,wBAAN,CAA+B;AACD,aAAjBC,iBAAiB,GAAG;AAC7B,WAAO,CAAP;AACD;;AACQ,SAAFC,EAAE,GAAG;AACV,UAAM,IAAIL,KAAJ,CAAUF,sBAAV,CAAN;AACD;;AACU,SAAJQ,IAAI,GAAG;AACZ,UAAM,IAAIN,KAAJ,CAAUF,sBAAV,CAAN;AACD;;AACDS,EAAAA,WAAW,GAAG;AACZ,UAAM,IAAIP,KAAJ,CAAUF,sBAAV,CAAN;AACD;;AAZ4B;;AAe/B,OAAO,MAAMU,eAAe,GAAG,OAAOC,MAAP,KAAkB,WAA1C;AACP,OAAO,MAAMC,sBAAsB,GAAG,OAAOC,aAAP,KAAyB,WAAxD;AACP,OAAO,MAAMC,uBAAuB,GAAG,OAAOC,cAAP,KAA0B,WAA1D;;AAEP,MAAMC,UAAU,GAAG,CAAC,MAAM;AACxB,SAAON,eAAe,GAAGC,MAAH,GAAYV,iBAAlC;AACD,CAFkB,GAAnB;;AAIA,MAAMgB,iBAAiB,GAAG,CAAC,MAAM;AAC/B,SAAOL,sBAAsB,GAAGC,aAAH,GAAmBR,wBAAhD;AACD,CAFyB,GAA1B;;AAIA,MAAMa,kBAAkB,GAAG,CAAC,MAAM;AAChC,SAAOJ,uBAAuB,GAAG,CAACC,cAAD,CAAH,GAAsB,CAACV,wBAAD,CAApD;AACD,CAF0B,GAA3B;;AAIA,SAAQW,UAAU,IAAIL,MAAtB;AACA,SAAQM,iBAAiB,IAAIJ,aAA7B;AACA,SAAQK,kBAAkB,IAAIH,cAA9B","sourcesContent":["// BigInt compatibility layer\n// Inspired by ArrowJS (under Apache2 license)\n// https://github.com/apache/arrow/blob/master/js/src/util/compat.ts\n// Requires tsconfig.json: target=esnext or (lib: esnext.bigint)\n// Requires eslint: env: {es2020: true}\n\nconst ERR_BIGINT_UNAVAILABLE = 'BigInt is not available in this environment';\n\nfunction BigIntUnavailable() {\n throw new Error(ERR_BIGINT_UNAVAILABLE);\n}\nBigIntUnavailable.asIntN = () => {\n throw new Error(ERR_BIGINT_UNAVAILABLE);\n};\nBigIntUnavailable.asUintN = () => {\n throw new Error(ERR_BIGINT_UNAVAILABLE);\n};\n\nclass BigInt64ArrayUnavailable {\n static get BYTES_PER_ELEMENT() {\n return 8;\n }\n static of() {\n throw new Error(ERR_BIGINT_UNAVAILABLE);\n }\n static from() {\n throw new Error(ERR_BIGINT_UNAVAILABLE);\n }\n constructor() {\n throw new Error(ERR_BIGINT_UNAVAILABLE);\n }\n}\n\nexport const BigIntAvailable = typeof BigInt !== 'undefined';\nexport const BigInt64ArrayAvailable = typeof BigInt64Array !== 'undefined';\nexport const BigUint64ArrayAvailable = typeof BigUint64Array !== 'undefined';\n\nconst BigIntCtor = (() => {\n return BigIntAvailable ? BigInt : BigIntUnavailable;\n})();\n\nconst BigInt64ArrayCtor = (() => {\n return BigInt64ArrayAvailable ? BigInt64Array : BigInt64ArrayUnavailable;\n})();\n\nconst BigUint64ArrayCtor = (() => {\n return BigUint64ArrayAvailable ? [BigUint64Array] : [BigInt64ArrayUnavailable];\n})();\n\nexport {BigIntCtor as BigInt};\nexport {BigInt64ArrayCtor as BigInt64Array};\nexport {BigUint64ArrayCtor as BigUint64Array};\n"],"file":"bigint.js"}
package/dist/esm/index.js DELETED
@@ -1,2 +0,0 @@
1
- export { TypedArray, NumberArray, NumericArray } from './number-array';
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/index.ts"],"names":["TypedArray","NumberArray","NumericArray"],"mappings":"AAAA,SAAQA,UAAR,EAAoBC,WAApB,EAAiCC,YAAjC,QAAoD,gBAApD","sourcesContent":["export {TypedArray, NumberArray, NumericArray} from './number-array';\n"],"file":"index.js"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=number-array.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"number-array.js"}
@@ -1,13 +0,0 @@
1
- /**
2
- * TypeScript type covering all typed arrays
3
- */
4
- export declare type TypedArray = Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array;
5
- /**
6
- * TypeScript type covering all typed arrays and classic arrays consisting of numbers
7
- */
8
- export declare type NumericArray = TypedArray | number[];
9
- /**
10
- * TypeScript type covering all typed arrays and classic arrays consisting of numbers
11
- */
12
- export declare type NumberArray = TypedArray | number[];
13
- //# sourceMappingURL=number-array.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"number-array.d.ts","sourceRoot":"","sources":["../src/number-array.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,UAAU,GAClB,SAAS,GACT,UAAU,GACV,UAAU,GACV,WAAW,GACX,UAAU,GACV,WAAW,GACX,iBAAiB,GACjB,YAAY,GACZ,YAAY,CAAC;AAMjB;;GAEG;AACH,oBAAY,YAAY,GAAG,UAAU,GAAG,MAAM,EAAE,CAAC;AAEjD;;GAEG;AACH,oBAAY,WAAW,GAAG,UAAU,GAAG,MAAM,EAAE,CAAC"}
File without changes