is-any-array
Advanced tools
| /** | ||
| * Checks if an object is an instance of an Array (array or typed array). | ||
| * | ||
| * @param {any} value - Object to check. | ||
| * @returns {boolean} True if the object is an array. | ||
| */ | ||
| export function isAnyArray(value: any): boolean; | ||
| //# sourceMappingURL=index.d.ts.map |
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,kCAHW,GAAG,GACD,OAAO,CAInB"} |
| const toString = Object.prototype.toString; | ||
| /** | ||
| * Checks if an object is an instance of an Array (array or typed array). | ||
| * | ||
| * @param {any} value - Object to check. | ||
| * @returns {boolean} True if the object is an array. | ||
| */ | ||
| export function isAnyArray(value) { | ||
| return toString.call(value).endsWith('Array]'); | ||
| } | ||
| //# sourceMappingURL=index.js.map |
| {"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"} |
| /** | ||
| * Checks if an object is an instance of an Array (array or typed array). | ||
| * | ||
| * @param {any} value - Object to check. | ||
| * @returns {boolean} True if the object is an array. | ||
| */ | ||
| export function isAnyArray(value: any): boolean; | ||
| //# sourceMappingURL=index.d.ts.map |
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,kCAHW,GAAG,GACD,OAAO,CAInB"} |
| {"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"} |
+11
-0
| # Changelog | ||
| ## [2.0.0](https://www.github.com/cheminfo/is-any-array/compare/v1.0.1...v2.0.0) (2021-10-15) | ||
| ### ⚠ BREAKING CHANGES | ||
| When using this project you will need to use a named import: `import { isAnyArray } from 'is-any-array'`. | ||
| ### Code Refactoring | ||
| * 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)) | ||
| ### [1.0.1](https://www.github.com/cheminfo/is-any-array/compare/v1.0.0...v1.0.1) (2021-06-30) | ||
@@ -4,0 +15,0 @@ |
+13
-9
@@ -1,11 +0,15 @@ | ||
| 'use strict'; | ||
| Object.defineProperty(exports, '__esModule', { value: true }); | ||
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.isAnyArray = void 0; | ||
| const toString = Object.prototype.toString; | ||
| function isAnyArray(object) { | ||
| return toString.call(object).endsWith('Array]'); | ||
| /** | ||
| * Checks if an object is an instance of an Array (array or typed array). | ||
| * | ||
| * @param {any} value - Object to check. | ||
| * @returns {boolean} True if the object is an array. | ||
| */ | ||
| function isAnyArray(value) { | ||
| return toString.call(value).endsWith('Array]'); | ||
| } | ||
| exports['default'] = isAnyArray; | ||
| exports.isAnyArray = isAnyArray; | ||
| //# sourceMappingURL=index.js.map |
+22
-21
| { | ||
| "name": "is-any-array", | ||
| "version": "1.0.1", | ||
| "version": "2.0.0", | ||
| "description": "Check if a value is any kind of array", | ||
| "main": "lib/index.js", | ||
| "module": "src/index.js", | ||
| "main": "./lib/index.js", | ||
| "module": "./lib-esm/index.js", | ||
| "types": "./lib/index.d.ts", | ||
| "files": [ | ||
| "lib", | ||
| "lib-esm", | ||
| "src" | ||
| ], | ||
| "scripts": { | ||
| "check-types": "tsc --noEmit", | ||
| "clean": "rimraf lib lib-esm", | ||
| "eslint": "eslint src", | ||
| "eslint-fix": "npm run eslint -- --fix", | ||
| "prepack": "rollup -c", | ||
| "test": "npm run test-coverage && npm run eslint", | ||
| "prepack": "npm run tsc", | ||
| "prettier": "prettier --check src", | ||
| "prettier-write": "prettier --write src", | ||
| "tsc": "npm run clean && npm run tsc-cjs && npm run tsc-esm", | ||
| "tsc-cjs": "tsc --project tsconfig.cjs.json", | ||
| "tsc-esm": "tsc --project tsconfig.esm.json", | ||
| "test": "npm run test-coverage && npm run eslint && npm run check-types", | ||
| "test-coverage": "jest --coverage", | ||
@@ -30,20 +39,12 @@ "test-only": "jest" | ||
| "homepage": "https://github.com/cheminfo-js/is-any-array#readme", | ||
| "jest": { | ||
| "testEnvironment": "node" | ||
| }, | ||
| "devDependencies": { | ||
| "@babel/plugin-transform-modules-commonjs": "^7.14.5", | ||
| "cheminfo-build": "^1.1.11", | ||
| "cheminfo-tools": "^1.23.3", | ||
| "codecov": "^3.8.2", | ||
| "eslint": "^7.29.0", | ||
| "eslint-config-cheminfo": "^5.2.4", | ||
| "eslint-plugin-import": "^2.23.4", | ||
| "eslint-plugin-jest": "^24.3.6", | ||
| "eslint-plugin-prettier": "^3.4.0", | ||
| "jest": "^27.0.6", | ||
| "npm-run-all": "^4.1.5", | ||
| "prettier": "^2.3.2", | ||
| "rollup": "^2.52.4" | ||
| "@types/jest": "^27.0.2", | ||
| "eslint": "^8.0.1", | ||
| "eslint-config-cheminfo-typescript": "^10.1.1", | ||
| "jest": "^27.2.5", | ||
| "prettier": "^2.4.1", | ||
| "rimraf": "^3.0.2", | ||
| "ts-jest": "^27.0.6", | ||
| "typescript": "^4.4.4" | ||
| } | ||
| } |
+1
-1
@@ -16,3 +16,3 @@ # is-any-array | ||
| ```js | ||
| const isAnyArray = require('is-any-array'); | ||
| const {isAnyArray} = require('is-any-array'); | ||
@@ -19,0 +19,0 @@ isAnyArray(1); // false |
@@ -1,2 +0,2 @@ | ||
| import isAnyArray from '..'; | ||
| import { isAnyArray } from '..'; | ||
@@ -3,0 +3,0 @@ test('isArray', () => { |
+8
-2
| const toString = Object.prototype.toString; | ||
| export default function isAnyArray(object) { | ||
| return toString.call(object).endsWith('Array]'); | ||
| /** | ||
| * Checks if an object is an instance of an Array (array or typed array). | ||
| * | ||
| * @param {any} value - Object to check. | ||
| * @returns {boolean} True if the object is an array. | ||
| */ | ||
| export function isAnyArray(value) { | ||
| return toString.call(value).endsWith('Array]'); | ||
| } |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
7593
57.01%8
-38.46%14
100%57
185%0
-100%