is-any-array 1.0.1 → 2.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/CHANGELOG.md +11 -0
- package/README.md +1 -1
- package/lib/index.d.ts +8 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +13 -9
- package/lib/index.js.map +1 -0
- package/lib-esm/index.d.ts +8 -0
- package/lib-esm/index.d.ts.map +1 -0
- package/lib-esm/index.js +11 -0
- package/lib-esm/index.js.map +1 -0
- package/package.json +22 -21
- package/src/__tests__/test.js +1 -1
- package/src/index.js +8 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [2.0.0](https://www.github.com/cheminfo/is-any-array/compare/v1.0.1...v2.0.0) (2021-10-15)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### ⚠ BREAKING CHANGES
|
|
7
|
+
|
|
8
|
+
When using this project you will need to use a named import: `import { isAnyArray } from 'is-any-array'`.
|
|
9
|
+
|
|
10
|
+
### Code Refactoring
|
|
11
|
+
|
|
12
|
+
* setup project for TypeScript ([#7](https://www.github.com/cheminfo/is-any-array/issues/7)) ([21e47a0](https://www.github.com/cheminfo/is-any-array/commit/21e47a02e36987208b5aa22906c1cbfee3322775))
|
|
13
|
+
|
|
3
14
|
### [1.0.1](https://www.github.com/cheminfo/is-any-array/compare/v1.0.0...v1.0.1) (2021-06-30)
|
|
4
15
|
|
|
5
16
|
|
package/README.md
CHANGED
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks if an object is an instance of an Array (array or typed array).
|
|
3
|
+
*
|
|
4
|
+
* @param {any} value - Object to check.
|
|
5
|
+
* @returns {boolean} True if the object is an array.
|
|
6
|
+
*/
|
|
7
|
+
export function isAnyArray(value: any): boolean;
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,kCAHW,GAAG,GACD,OAAO,CAInB"}
|
package/lib/index.js
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isAnyArray = void 0;
|
|
5
4
|
const toString = Object.prototype.toString;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Checks if an object is an instance of an Array (array or typed array).
|
|
7
|
+
*
|
|
8
|
+
* @param {any} value - Object to check.
|
|
9
|
+
* @returns {boolean} True if the object is an array.
|
|
10
|
+
*/
|
|
11
|
+
function isAnyArray(value) {
|
|
12
|
+
return toString.call(value).endsWith('Array]');
|
|
9
13
|
}
|
|
10
|
-
|
|
11
|
-
|
|
14
|
+
exports.isAnyArray = isAnyArray;
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":";;;AAAA,MAAM,QAAQ,GAAG,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC;AAE3C;;;;;GAKG;AACH,SAAgB,UAAU,CAAC,KAAK;IAC9B,OAAO,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AACjD,CAAC;AAFD,gCAEC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks if an object is an instance of an Array (array or typed array).
|
|
3
|
+
*
|
|
4
|
+
* @param {any} value - Object to check.
|
|
5
|
+
* @returns {boolean} True if the object is an array.
|
|
6
|
+
*/
|
|
7
|
+
export function isAnyArray(value: any): boolean;
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,kCAHW,GAAG,GACD,OAAO,CAInB"}
|
package/lib-esm/index.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const toString = Object.prototype.toString;
|
|
2
|
+
/**
|
|
3
|
+
* Checks if an object is an instance of an Array (array or typed array).
|
|
4
|
+
*
|
|
5
|
+
* @param {any} value - Object to check.
|
|
6
|
+
* @returns {boolean} True if the object is an array.
|
|
7
|
+
*/
|
|
8
|
+
export function isAnyArray(value) {
|
|
9
|
+
return toString.call(value).endsWith('Array]');
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":"AAAA,MAAM,QAAQ,GAAG,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC;AAE3C;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,KAAK;IAC9B,OAAO,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AACjD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,18 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "is-any-array",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Check if a value is any kind of array",
|
|
5
|
-
"main": "lib/index.js",
|
|
6
|
-
"module": "
|
|
5
|
+
"main": "./lib/index.js",
|
|
6
|
+
"module": "./lib-esm/index.js",
|
|
7
|
+
"types": "./lib/index.d.ts",
|
|
7
8
|
"files": [
|
|
8
9
|
"lib",
|
|
10
|
+
"lib-esm",
|
|
9
11
|
"src"
|
|
10
12
|
],
|
|
11
13
|
"scripts": {
|
|
14
|
+
"check-types": "tsc --noEmit",
|
|
15
|
+
"clean": "rimraf lib lib-esm",
|
|
12
16
|
"eslint": "eslint src",
|
|
13
17
|
"eslint-fix": "npm run eslint -- --fix",
|
|
14
|
-
"prepack": "
|
|
15
|
-
"
|
|
18
|
+
"prepack": "npm run tsc",
|
|
19
|
+
"prettier": "prettier --check src",
|
|
20
|
+
"prettier-write": "prettier --write src",
|
|
21
|
+
"tsc": "npm run clean && npm run tsc-cjs && npm run tsc-esm",
|
|
22
|
+
"tsc-cjs": "tsc --project tsconfig.cjs.json",
|
|
23
|
+
"tsc-esm": "tsc --project tsconfig.esm.json",
|
|
24
|
+
"test": "npm run test-coverage && npm run eslint && npm run check-types",
|
|
16
25
|
"test-coverage": "jest --coverage",
|
|
17
26
|
"test-only": "jest"
|
|
18
27
|
},
|
|
@@ -27,22 +36,14 @@
|
|
|
27
36
|
"url": "https://github.com/cheminfo-js/is-any-array/issues"
|
|
28
37
|
},
|
|
29
38
|
"homepage": "https://github.com/cheminfo-js/is-any-array#readme",
|
|
30
|
-
"jest": {
|
|
31
|
-
"testEnvironment": "node"
|
|
32
|
-
},
|
|
33
39
|
"devDependencies": {
|
|
34
|
-
"@
|
|
35
|
-
"
|
|
36
|
-
"cheminfo-
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"eslint-plugin-prettier": "^3.4.0",
|
|
43
|
-
"jest": "^27.0.6",
|
|
44
|
-
"npm-run-all": "^4.1.5",
|
|
45
|
-
"prettier": "^2.3.2",
|
|
46
|
-
"rollup": "^2.52.4"
|
|
40
|
+
"@types/jest": "^27.0.2",
|
|
41
|
+
"eslint": "^8.0.1",
|
|
42
|
+
"eslint-config-cheminfo-typescript": "^10.1.1",
|
|
43
|
+
"jest": "^27.2.5",
|
|
44
|
+
"prettier": "^2.4.1",
|
|
45
|
+
"rimraf": "^3.0.2",
|
|
46
|
+
"ts-jest": "^27.0.6",
|
|
47
|
+
"typescript": "^4.4.4"
|
|
47
48
|
}
|
|
48
49
|
}
|
package/src/__tests__/test.js
CHANGED
package/src/index.js
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
const toString = Object.prototype.toString;
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Checks if an object is an instance of an Array (array or typed array).
|
|
5
|
+
*
|
|
6
|
+
* @param {any} value - Object to check.
|
|
7
|
+
* @returns {boolean} True if the object is an array.
|
|
8
|
+
*/
|
|
9
|
+
export function isAnyArray(value) {
|
|
10
|
+
return toString.call(value).endsWith('Array]');
|
|
5
11
|
}
|