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 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][travis-image]][travis-url]
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 toString.call ends with Array
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
- isAnyArray(1); // false
23
- isAnyArray('ab'); // false
24
- isAnyArray({ a: 1 }); // false
18
+ isAnyArray(1); // false
19
+ isAnyArray('ab'); // false
20
+ isAnyArray({ a: 1 }); // false
25
21
 
26
- isAnyArray([1, 2, 3]); // true
27
- isAnyArray(new Uint16Array(2))) // true;
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?style=flat-square
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
- [travis-image]: https://img.shields.io/travis/cheminfo-js/is-any-array/master.svg?style=flat-square
37
- [travis-url]: https://travis-ci.org/cheminfo-js/is-any-array
38
- [codecov-image]: https://img.shields.io/codecov/c/github/cheminfo-js/is-any-array.svg?style=flat-square
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
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
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
- function isAnyArray(object) {
8
- return toString.call(object).endsWith('Array]');
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
- exports.default = isAnyArray;
14
+ exports.isAnyArray = isAnyArray;
15
+ //# 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,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"}
@@ -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.1.0",
4
- "description": "Check if toString.call ends with Array",
5
- "main": "lib/index.js",
6
- "module": "src/index.js",
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
- "prepublishOnly": "rollup -c",
15
- "test": "run-s testonly eslint",
16
- "test-travis": "eslint src && jest --coverage && codecov",
17
- "testonly": "jest",
18
- "build": "cheminfo-build --entry src/index.js"
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
- "@babel/plugin-transform-modules-commonjs": "^7.8.3",
36
- "cheminfo-build": "^1.0.7",
37
- "cheminfo-tools": "^1.23.3",
38
- "codecov": "^3.6.5",
39
- "eslint": "^6.8.0",
40
- "eslint-config-cheminfo": "^2.0.4",
41
- "eslint-plugin-import": "^2.20.1",
42
- "eslint-plugin-jest": "^23.8.0",
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
  }
@@ -1,4 +1,4 @@
1
- import isAnyArray from '..';
1
+ import { isAnyArray } from '..';
2
2
 
3
3
  test('isArray', () => {
4
4
  expect(isAnyArray(1)).toBe(false);
package/src/index.js CHANGED
@@ -1,5 +1,11 @@
1
1
  const toString = Object.prototype.toString;
2
2
 
3
- export default function isAnyArray(object) {
4
- return toString.call(object).endsWith('Array]');
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
-