is-any-array 0.1.0 → 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 +40 -0
- package/README.md +12 -20
- 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 +25 -27
- package/src/__tests__/test.js +1 -1
- package/src/index.js +8 -2
- package/History.md +0 -14
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Changelog
|
|
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
|
+
|
|
14
|
+
### [1.0.1](https://www.github.com/cheminfo/is-any-array/compare/v1.0.0...v1.0.1) (2021-06-30)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* rollup in dependencies ! ([7c26c34](https://www.github.com/cheminfo/is-any-array/commit/7c26c3416287c57eaeb9fc481fb2a7b107cfa984))
|
|
20
|
+
|
|
21
|
+
## [1.0.0](https://www.github.com/cheminfo/is-any-array/compare/v0.1.1...v1.0.0) (2021-03-24)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### Bug Fixes
|
|
25
|
+
|
|
26
|
+
* update readme and dependencies ([7ae8169](https://www.github.com/cheminfo/is-any-array/commit/7ae8169b1105bc9e3586f6a73315897326bb1bd4))
|
|
27
|
+
|
|
28
|
+
### [0.1.1](https://github.com/cheminfo-js/is-any-array/compare/v0.1.0...v0.1.1) (2021-02-11)
|
|
29
|
+
|
|
30
|
+
# [0.1.0](https://github.com/cheminfo-js/is-any-array/compare/v0.0.3...v0.1.0) (2020-02-25)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
<a name="0.0.3"></a>
|
|
35
|
+
## [0.0.3](https://github.com/cheminfo-js/is-any-array/compare/v0.0.2...v0.0.3) (2018-10-26)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
<a name="0.0.2"></a>
|
|
40
|
+
## 0.0.2 (2018-10-26)
|
package/README.md
CHANGED
|
@@ -1,43 +1,35 @@
|
|
|
1
1
|
# is-any-array
|
|
2
2
|
|
|
3
3
|
[![NPM version][npm-image]][npm-url]
|
|
4
|
-
[![build status][
|
|
5
|
-
[![Test coverage][codecov-image]][codecov-url]
|
|
6
|
-
[![David deps][david-image]][david-url]
|
|
4
|
+
[![build status][build-image]][build-url]
|
|
7
5
|
[![npm download][download-image]][download-url]
|
|
8
6
|
|
|
9
|
-
Check if
|
|
7
|
+
Check if a value is any kind of array.
|
|
10
8
|
|
|
11
9
|
## Installation
|
|
12
10
|
|
|
13
11
|
`$ npm install is-any-array`
|
|
14
12
|
|
|
15
|
-
## [API Documentation](https://cheminfo-js.github.io/is-any-array/)
|
|
16
|
-
|
|
17
13
|
## Example
|
|
18
14
|
|
|
19
15
|
```js
|
|
20
|
-
const isAnyArray = require('is-any-array');
|
|
16
|
+
const {isAnyArray} = require('is-any-array');
|
|
21
17
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
isAnyArray(1); // false
|
|
19
|
+
isAnyArray('ab'); // false
|
|
20
|
+
isAnyArray({ a: 1 }); // false
|
|
25
21
|
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
isAnyArray([1, 2, 3]); // true
|
|
23
|
+
isAnyArray(new Uint16Array(2))) // true;
|
|
28
24
|
```
|
|
29
25
|
|
|
30
26
|
## License
|
|
31
27
|
|
|
32
28
|
[MIT](./LICENSE)
|
|
33
29
|
|
|
34
|
-
[npm-image]: https://img.shields.io/npm/v/is-any-array.svg
|
|
30
|
+
[npm-image]: https://img.shields.io/npm/v/is-any-array.svg
|
|
35
31
|
[npm-url]: https://www.npmjs.com/package/is-any-array
|
|
36
|
-
[
|
|
37
|
-
[
|
|
38
|
-
[
|
|
39
|
-
[codecov-url]: https://codecov.io/gh/cheminfo-js/is-any-array
|
|
40
|
-
[david-image]: https://img.shields.io/david/cheminfo-js/is-any-array.svg?style=flat-square
|
|
41
|
-
[david-url]: https://david-dm.org/cheminfo-js/is-any-array
|
|
42
|
-
[download-image]: https://img.shields.io/npm/dm/is-any-array.svg?style=flat-square
|
|
32
|
+
[build-image]: https://github.com/cheminfo/is-any-array/workflows/Node.js%20CI/badge.svg?branch=master
|
|
33
|
+
[build-url]: https://github.com/cheminfo/is-any-array/actions?query=workflow%3A%22Node.js+CI%22
|
|
34
|
+
[download-image]: https://img.shields.io/npm/dm/is-any-array.svg
|
|
43
35
|
[download-url]: https://www.npmjs.com/package/is-any-array
|
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,21 +1,29 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "is-any-array",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Check if
|
|
5
|
-
"main": "lib/index.js",
|
|
6
|
-
"module": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"description": "Check if a value is any kind of array",
|
|
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
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
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",
|
|
25
|
+
"test-coverage": "jest --coverage",
|
|
26
|
+
"test-only": "jest"
|
|
19
27
|
},
|
|
20
28
|
"repository": {
|
|
21
29
|
"type": "git",
|
|
@@ -28,24 +36,14 @@
|
|
|
28
36
|
"url": "https://github.com/cheminfo-js/is-any-array/issues"
|
|
29
37
|
},
|
|
30
38
|
"homepage": "https://github.com/cheminfo-js/is-any-array#readme",
|
|
31
|
-
"jest": {
|
|
32
|
-
"testEnvironment": "node"
|
|
33
|
-
},
|
|
34
39
|
"devDependencies": {
|
|
35
|
-
"@
|
|
36
|
-
"
|
|
37
|
-
"cheminfo-
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"eslint-plugin-prettier": "^3.1.2",
|
|
44
|
-
"jest": "^25.1.0",
|
|
45
|
-
"npm-run-all": "^4.1.5",
|
|
46
|
-
"prettier": "^1.19.1"
|
|
47
|
-
},
|
|
48
|
-
"dependencies": {
|
|
49
|
-
"rollup": "^1.31.1"
|
|
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"
|
|
50
48
|
}
|
|
51
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
|
}
|
package/History.md
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
# [0.1.0](https://github.com/cheminfo-js/is-any-array/compare/v0.0.3...v0.1.0) (2020-02-25)
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
<a name="0.0.3"></a>
|
|
6
|
-
## [0.0.3](https://github.com/cheminfo-js/is-any-array/compare/v0.0.2...v0.0.3) (2018-10-26)
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
<a name="0.0.2"></a>
|
|
11
|
-
## 0.0.2 (2018-10-26)
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|