is-any-array 2.0.1 → 3.0.0
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.
- package/lib/index.d.ts +0 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -6
- package/lib/index.js.map +1 -1
- package/package.json +18 -18
- package/src/index.ts +0 -1
- package/lib-esm/index.d.ts +0 -9
- package/lib-esm/index.d.ts.map +0 -1
- package/lib-esm/index.js +0 -13
- package/lib-esm/index.js.map +0 -1
- package/src/__tests__/test.ts +0 -12
package/lib/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export type AnyArray = any[] | Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array;
|
|
2
2
|
/**
|
|
3
3
|
* Checks if an object is an instance of an Array (array or typed array, except those that contain bigint values).
|
|
4
|
-
*
|
|
5
4
|
* @param value - Object to check.
|
|
6
5
|
* @returns True if the object is an array or a typed array.
|
|
7
6
|
*/
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,QAAQ,GAChB,GAAG,EAAE,GACL,SAAS,GACT,UAAU,GACV,iBAAiB,GACjB,UAAU,GACV,WAAW,GACX,UAAU,GACV,WAAW,GACX,YAAY,GACZ,YAAY,CAAC;AAEjB
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,QAAQ,GAChB,GAAG,EAAE,GACL,SAAS,GACT,UAAU,GACV,iBAAiB,GACjB,UAAU,GACV,WAAW,GACX,UAAU,GACV,WAAW,GACX,YAAY,GACZ,YAAY,CAAC;AAEjB;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,QAAQ,CAG5D"}
|
package/lib/index.js
CHANGED
|
@@ -1,17 +1,12 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isAnyArray = void 0;
|
|
4
1
|
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
5
2
|
const toString = Object.prototype.toString;
|
|
6
3
|
/**
|
|
7
4
|
* Checks if an object is an instance of an Array (array or typed array, except those that contain bigint values).
|
|
8
|
-
*
|
|
9
5
|
* @param value - Object to check.
|
|
10
6
|
* @returns True if the object is an array or a typed array.
|
|
11
7
|
*/
|
|
12
|
-
function isAnyArray(value) {
|
|
8
|
+
export function isAnyArray(value) {
|
|
13
9
|
const tag = toString.call(value);
|
|
14
10
|
return tag.endsWith('Array]') && !tag.includes('Big');
|
|
15
11
|
}
|
|
16
|
-
exports.isAnyArray = isAnyArray;
|
|
17
12
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,MAAM,QAAQ,GAAG,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC;AAc3C;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,KAAc;IACvC,MAAM,GAAG,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACjC,OAAO,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AACxD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "is-any-array",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Check if a value is any kind of array",
|
|
5
|
-
"
|
|
6
|
-
"
|
|
5
|
+
"type": "module",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": "./lib/index.js"
|
|
8
|
+
},
|
|
7
9
|
"types": "./lib/index.d.ts",
|
|
8
10
|
"files": [
|
|
9
11
|
"lib",
|
|
10
|
-
"lib-esm",
|
|
11
12
|
"src"
|
|
12
13
|
],
|
|
13
14
|
"scripts": {
|
|
14
15
|
"check-types": "tsc --noEmit",
|
|
15
|
-
"clean": "rimraf lib
|
|
16
|
+
"clean": "rimraf lib",
|
|
16
17
|
"eslint": "eslint src",
|
|
17
18
|
"eslint-fix": "npm run eslint -- --fix",
|
|
18
19
|
"prepack": "npm run tsc",
|
|
19
20
|
"prettier": "prettier --check src",
|
|
20
21
|
"prettier-write": "prettier --write src",
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"tsc
|
|
24
|
-
"
|
|
25
|
-
"test-only": "jest --coverage"
|
|
22
|
+
"test": "npm run test-only && npm run check-types && npm run eslint && npm run prettier",
|
|
23
|
+
"test-only": "vitest run --coverage",
|
|
24
|
+
"tsc": "npm run clean && npm run tsc-build",
|
|
25
|
+
"tsc-build": "tsc --project tsconfig.build.json"
|
|
26
26
|
},
|
|
27
27
|
"repository": {
|
|
28
28
|
"type": "git",
|
|
@@ -36,13 +36,13 @@
|
|
|
36
36
|
},
|
|
37
37
|
"homepage": "https://github.com/cheminfo-js/is-any-array#readme",
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@
|
|
40
|
-
"
|
|
41
|
-
"eslint
|
|
42
|
-
"
|
|
43
|
-
"prettier": "^
|
|
44
|
-
"rimraf": "^
|
|
45
|
-
"
|
|
46
|
-
"
|
|
39
|
+
"@vitest/coverage-v8": "^4.0.18",
|
|
40
|
+
"@zakodium/tsconfig": "^1.0.2",
|
|
41
|
+
"eslint": "^9.39.2",
|
|
42
|
+
"eslint-config-cheminfo-typescript": "^21.1.0",
|
|
43
|
+
"prettier": "^3.8.1",
|
|
44
|
+
"rimraf": "^6.1.3",
|
|
45
|
+
"typescript": "^5.9.3",
|
|
46
|
+
"vitest": "^4.0.18"
|
|
47
47
|
}
|
|
48
48
|
}
|
package/src/index.ts
CHANGED
package/lib-esm/index.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export type AnyArray = any[] | Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array;
|
|
2
|
-
/**
|
|
3
|
-
* Checks if an object is an instance of an Array (array or typed array, except those that contain bigint values).
|
|
4
|
-
*
|
|
5
|
-
* @param value - Object to check.
|
|
6
|
-
* @returns True if the object is an array or a typed array.
|
|
7
|
-
*/
|
|
8
|
-
export declare function isAnyArray(value: unknown): value is AnyArray;
|
|
9
|
-
//# sourceMappingURL=index.d.ts.map
|
package/lib-esm/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,QAAQ,GAChB,GAAG,EAAE,GACL,SAAS,GACT,UAAU,GACV,iBAAiB,GACjB,UAAU,GACV,WAAW,GACX,UAAU,GACV,WAAW,GACX,YAAY,GACZ,YAAY,CAAC;AAEjB;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,QAAQ,CAG5D"}
|
package/lib-esm/index.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
2
|
-
const toString = Object.prototype.toString;
|
|
3
|
-
/**
|
|
4
|
-
* Checks if an object is an instance of an Array (array or typed array, except those that contain bigint values).
|
|
5
|
-
*
|
|
6
|
-
* @param value - Object to check.
|
|
7
|
-
* @returns True if the object is an array or a typed array.
|
|
8
|
-
*/
|
|
9
|
-
export function isAnyArray(value) {
|
|
10
|
-
const tag = toString.call(value);
|
|
11
|
-
return tag.endsWith('Array]') && !tag.includes('Big');
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=index.js.map
|
package/lib-esm/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,MAAM,QAAQ,GAAG,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC;AAc3C;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,KAAc;IACvC,MAAM,GAAG,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACjC,OAAO,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AACxD,CAAC"}
|
package/src/__tests__/test.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { isAnyArray } from '..';
|
|
2
|
-
|
|
3
|
-
test('isArray', () => {
|
|
4
|
-
expect(isAnyArray(1)).toBe(false);
|
|
5
|
-
expect(isAnyArray('ab')).toBe(false);
|
|
6
|
-
expect(isAnyArray({ a: 1 })).toBe(false);
|
|
7
|
-
|
|
8
|
-
expect(isAnyArray([])).toBe(true);
|
|
9
|
-
expect(isAnyArray([1, 2, 3])).toBe(true);
|
|
10
|
-
expect(isAnyArray(new Uint16Array(2))).toBe(true);
|
|
11
|
-
expect(isAnyArray(new BigUint64Array(1))).toBe(false);
|
|
12
|
-
});
|