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 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
@@ -13,7 +13,7 @@ Check if a value is any kind of array.
13
13
  ## Example
14
14
 
15
15
  ```js
16
- const isAnyArray = require('is-any-array');
16
+ const {isAnyArray} = require('is-any-array');
17
17
 
18
18
  isAnyArray(1); // false
19
19
  isAnyArray('ab'); // false
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,18 +1,27 @@
1
1
  {
2
2
  "name": "is-any-array",
3
- "version": "1.0.1",
3
+ "version": "2.0.0",
4
4
  "description": "Check if a value is any kind of array",
5
- "main": "lib/index.js",
6
- "module": "src/index.js",
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": "rollup -c",
15
- "test": "npm run test-coverage && npm run eslint",
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
- "@babel/plugin-transform-modules-commonjs": "^7.14.5",
35
- "cheminfo-build": "^1.1.11",
36
- "cheminfo-tools": "^1.23.3",
37
- "codecov": "^3.8.2",
38
- "eslint": "^7.29.0",
39
- "eslint-config-cheminfo": "^5.2.4",
40
- "eslint-plugin-import": "^2.23.4",
41
- "eslint-plugin-jest": "^24.3.6",
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
  }
@@ -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
  }