array-slice-x
Advanced tools
Comparing version 3.5.0 to 4.0.0
165
package.json
{ | ||
"name": "array-slice-x", | ||
"version": "3.5.0", | ||
"version": "4.0.0", | ||
"description": "Cross-browser array slicer.", | ||
@@ -19,5 +19,25 @@ "homepage": "https://github.com/Xotic750/array-slice-x", | ||
], | ||
"main": "index.js", | ||
"engines": { | ||
"node": "*" | ||
"files": [ | ||
"dist", | ||
"src" | ||
], | ||
"module": "dist/array-slice-x.esm.js", | ||
"main": "dist/array-slice-x.js", | ||
"scripts": { | ||
"build:esm": "mkdirp dist && babel -s true --env-name esm src/array-slice-x.js -o dist/array-slice-x.esm.js", | ||
"build:base": "webpack --bail --progress --profile --colors", | ||
"build": "npm run build:esm && cross-env NODE_ENV=production npm run build:base --", | ||
"build:dev": "npm run build:base --", | ||
"clean": "rimraf dist && npm run clean:coverage", | ||
"clean:coverage": "rimraf __tests__/coverage", | ||
"lint": "eslint -f 'node_modules/eslint-friendly-formatter' --ext .js .", | ||
"lint-fix": "npm run lint -- --fix", | ||
"report": "npm run build -- --env.report", | ||
"report:dev": "npm run build:dev -- --env.report", | ||
"security": "npm audit", | ||
"security-fix": "npm run security -- fix", | ||
"start": "nodemon --exec \"npm run build\" --watch src", | ||
"test": "npm run clean:coverage && jest", | ||
"test:ci": "npm run test -- --ci --maxWorkers=2", | ||
"test:coverage": "npm run test -- --coverage" | ||
}, | ||
@@ -33,63 +53,86 @@ "license": "MIT", | ||
"dependencies": { | ||
"array-like-slice-x": "^1.2.0", | ||
"attempt-x": "^1.1.1", | ||
"cached-constructors-x": "^1.0.0", | ||
"is-arguments": "^1.0.2", | ||
"is-array-x": "^1.2.0", | ||
"array-like-slice-x": "^2.0.2", | ||
"attempt-x": "^2.0.3", | ||
"cached-constructors-x": "^2.0.3", | ||
"is-arguments": "^1.0.4", | ||
"is-array-x": "^2.0.4", | ||
"is-string": "^1.0.4", | ||
"to-object-x": "^1.5.0" | ||
"to-object-x": "^2.0.0" | ||
}, | ||
"devDependencies": { | ||
"@xotic750/eslint-config-standard-x": "^2.2.1", | ||
"browserify": "^14.4.0", | ||
"browserify-derequire": "^0.9.4", | ||
"cross-env": "^5.0.1", | ||
"es5-shim": "^4.5.9", | ||
"es6-shim": "^0.35.3", | ||
"es7-shim": "^6.0.0", | ||
"eslint": "^4.6.1", | ||
"eslint-plugin-compat": "^1.0.4", | ||
"eslint-plugin-css-modules": "^2.7.2", | ||
"eslint-plugin-eslint-comments": "^1.0.2", | ||
"eslint-plugin-jsdoc": "^3.1.1", | ||
"eslint-plugin-json": "^1.2.0", | ||
"eslint-plugin-no-use-extend-native": "^0.3.12", | ||
"husky": "^0.13.4", | ||
"jasmine-node": "^1.14.5", | ||
"jsdoc-to-markdown": "^3.0.0", | ||
"json3": "^3.3.2", | ||
"make-jasmine-spec-runner-html": "^1.3.0", | ||
"ncp": "^2.0.0", | ||
"nodemon": "^1.11.0", | ||
"nsp": "^2.6.3", | ||
"parallelshell": "^3.0.1", | ||
"replace-x": "^1.5.0", | ||
"rimraf": "^2.6.1", | ||
"serve": "^6.0.2", | ||
"uglify-js": "^3.0.24" | ||
"@babel/cli": "^7.5.0", | ||
"@babel/core": "^7.5.4", | ||
"@babel/node": "^7.5.0", | ||
"@babel/plugin-proposal-class-properties": "^7.5.0", | ||
"@babel/plugin-syntax-dynamic-import": "^7.2.0", | ||
"@babel/plugin-syntax-export-default-from": "^7.2.0", | ||
"@babel/plugin-syntax-export-namespace-from": "^7.2.0", | ||
"@babel/plugin-transform-property-mutators": "^7.2.0", | ||
"@babel/plugin-transform-runtime": "^7.5.0", | ||
"@babel/preset-env": "^7.5.4", | ||
"@babel/runtime": "^7.5.4", | ||
"@prorenata/eslint-config-vue": "^1.13.6", | ||
"@types/jest": "^24.0.15", | ||
"@types/node": "^12.6.2", | ||
"babel-core": "^7.0.0-0", | ||
"babel-eslint": "^10.0.2", | ||
"babel-loader": "^8.0.6", | ||
"babel-plugin-lodash": "^3.3.4", | ||
"caniuse-lite": "^1.0.30000983", | ||
"chalk": "^2.4.2", | ||
"concurrently": "^4.1.1", | ||
"cross-env": "^5.2.0", | ||
"eslint": "=5.16.0", | ||
"eslint-config-airbnb-base": "^13.2.0", | ||
"eslint-config-prettier": "^6.0.0", | ||
"eslint-friendly-formatter": "^4.0.1", | ||
"eslint-import-resolver-webpack": "^0.11.1", | ||
"eslint-loader": "^2.2.1", | ||
"eslint-plugin-babel": "^5.3.0", | ||
"eslint-plugin-compat": "^3.2.0", | ||
"eslint-plugin-css-modules": "^2.11.0", | ||
"eslint-plugin-eslint-comments": "^3.1.2", | ||
"eslint-plugin-html": "^6.0.0", | ||
"eslint-plugin-import": "^2.18.0", | ||
"eslint-plugin-jest": "^22.7.2", | ||
"eslint-plugin-jsdoc": "^15.3.5", | ||
"eslint-plugin-json": "^1.4.0", | ||
"eslint-plugin-lodash": "^5.1.0", | ||
"eslint-plugin-no-use-extend-native": "^0.4.1", | ||
"eslint-plugin-prefer-object-spread": "^1.2.1", | ||
"eslint-plugin-prettier": "^3.1.0", | ||
"eslint-plugin-promise": "^4.2.1", | ||
"eslint-plugin-sort-class-members": "^1.5.0", | ||
"eslint-plugin-switch-case": "^1.1.2", | ||
"eslint-plugin-vue": "^5.2.3", | ||
"friendly-errors-webpack-plugin": "^1.7.0", | ||
"identity-obj-proxy": "^3.0.0", | ||
"jest": "^24.8.0", | ||
"jest-cli": "^24.8.0", | ||
"jest-file": "^1.0.0", | ||
"jsdoc-to-markdown": "^5.0.0", | ||
"lodash": "^4.17.14", | ||
"lodash-webpack-plugin": "^0.11.5", | ||
"mkdirp": "^0.5.1", | ||
"node-notifier": "^5.4.0", | ||
"nodemon": "^1.19.1", | ||
"prettier": "=1.14.3", | ||
"rimraf": "^2.6.3", | ||
"semver": "^6.2.0", | ||
"source-map-loader": "^0.2.4", | ||
"terser-webpack-plugin": "^1.3.0", | ||
"typescript": "^3.5.3", | ||
"webpack": "^4.35.3", | ||
"webpack-bundle-analyzer": "^3.3.2", | ||
"webpack-cli": "^3.3.5", | ||
"webpack-merge": "^4.2.1" | ||
}, | ||
"scripts": { | ||
"clean": "rimraf README.md lib/*", | ||
"clean:jasmine": "rimraf tests/index.html tests/run.js", | ||
"clean:all": "npm run clean:jasmine && npm run clean", | ||
"build": "npm run clean && npm run lint && npm run browserify && npm run uglify && npm run docs && npm test && npm run security", | ||
"build:jasmine": "npm run clean:jasmine && make-jasmine-spec-runner-html", | ||
"build:setver": "replace-x \" @version .*\" \" @version $(node -p -e \"require('./package.json').version\")\" index.js", | ||
"build:name": "replace-x \" @module .*\" \" @module $(node -p -e \"require('./package.json').name\")\" index.js", | ||
"build:description": "replace-x \" @file .*\" \" @file $(node -p -e \"require('./package.json').description\")\" index.js", | ||
"build:replace": "npm run build:setver && npm run build:name && npm run build:description", | ||
"production": "npm run clean:all && npm run build:jasmine && npm run build:replace && npm run build", | ||
"start": "parallelshell \"serve\" \"nodemon --watch index.js --exec 'npm run build'\"", | ||
"docs:name": "replace-x \"@{PACKAGE-NAME}\" \"$(node -p -e \"require('./package.json').name\")\" README.md", | ||
"docs:badges": "ncp badges.html README.md && npm run docs:name", | ||
"docs": "npm run docs:badges && jsdoc2md --name-format --example-lang js index.js >> README.md", | ||
"lint": "eslint *.js tests/spec/*.js", | ||
"lint-fix": "npm run lint -- --fix", | ||
"security": "nsp check", | ||
"test": "jasmine-node --matchall tests/spec/", | ||
"browserify": "browserify -p browserify-derequire -e index.js -o lib/array-slice-x.js -u 'crypto' -s returnExports", | ||
"uglify": "uglifyjs lib/array-slice-x.js -o lib/array-slice-x.min.js --config-file .uglifyjsrc.json", | ||
"precommit": "npm run production", | ||
"prepush": "npm run production" | ||
} | ||
"engines": { | ||
"node": ">=8.11.4", | ||
"npm": "6.4.1" | ||
}, | ||
"browserslist": [ | ||
"> 1%", | ||
"Explorer >= 9" | ||
] | ||
} |
@@ -24,11 +24,9 @@ <a href="https://travis-ci.org/Xotic750/array-slice-x" | ||
## array-slice-x | ||
Cross-browser array slicer. | ||
**Version**: 3.5.0 | ||
**Author**: Xotic750 <Xotic750@gmail.com> | ||
**License**: [MIT](<https://opensource.org/licenses/MIT>) | ||
**Copyright**: Xotic750 | ||
<a name="exp_module_array-slice-x--module.exports"></a> | ||
### `module.exports(array, [start], [end])` ⇒ <code>Array</code> ⏏ | ||
The slice() method returns a shallow copy of a portion of an array into a new | ||
@@ -39,18 +37,17 @@ array object selected from begin to end (end not included). The original | ||
**Kind**: Exported function | ||
**Returns**: <code>Array</code> - A new array containing the extracted elements. | ||
**Returns**: <code>Array</code> - A new array containing the extracted elements. | ||
| Param | Type | Description | | ||
| --- | --- | --- | | ||
| array | <code>Array</code> \| <code>Object</code> | The array to slice. | | ||
| [start] | <code>number</code> | Zero-based index at which to begin extraction. A negative index can be used, indicating an offset from the end of the sequence. slice(-2) extracts the last two elements in the sequence. If begin is undefined, slice begins from index 0. | | ||
| [end] | <code>number</code> | Zero-based index before which to end extraction. Slice extracts up to but not including end. For example, slice(1,4) extracts the second element through the fourth element (elements indexed 1, 2, and 3). A negative index can be used, indicating an offset from the end of the sequence. slice(2,-1) extracts the third element through the second-to-last element in the sequence. If end is omitted, slice extracts through the end of the sequence (arr.length). If end is greater than the length of the sequence, slice extracts through the end of the sequence (arr.length). | | ||
| Param | Type | Description | | ||
| ------- | ----------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| array | <code>Array</code> \| <code>Object</code> | The array to slice. | | ||
| [start] | <code>number</code> | Zero-based index at which to begin extraction. A negative index can be used, indicating an offset from the end of the sequence. slice(-2) extracts the last two elements in the sequence. If begin is undefined, slice begins from index 0. | | ||
| [end] | <code>number</code> | Zero-based index before which to end extraction. Slice extracts up to but not including end. For example, slice(1,4) extracts the second element through the fourth element (elements indexed 1, 2, and 3). A negative index can be used, indicating an offset from the end of the sequence. slice(2,-1) extracts the third element through the second-to-last element in the sequence. If end is omitted, slice extracts through the end of the sequence (arr.length). If end is greater than the length of the sequence, slice extracts through the end of the sequence (arr.length). | | ||
**Example** | ||
**Example** | ||
```js | ||
var slice = require('array-slice-x'); | ||
var fruits = ['Banana', 'Orange', 'Lemon', 'Apple', 'Mango']; | ||
var citrus = slice(fruits, 1, 3); | ||
import slice from 'array-slice-x'; | ||
// fruits contains ['Banana', 'Orange', 'Lemon', 'Apple', 'Mango'] | ||
// citrus contains ['Orange','Lemon'] | ||
const fruits = ['Banana', 'Orange', 'Lemon', 'Apple', 'Mango']; | ||
console.log(slice(fruits, 1, 3)); // citrus contains ['Orange','Lemon'] | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
238179
0
0
1
66
10
1758
52
+ Addedarray-like-slice-x@2.2.2(transitive)
+ Addedattempt-x@2.1.2(transitive)
+ Addedcached-constructors-x@2.2.1(transitive)
+ Addedhas-boxed-string-x@2.1.1(transitive)
+ Addedhas-symbol-support-x@2.1.2(transitive)
+ Addedhas-to-string-tag-x@2.1.2(transitive)
+ Addedhas-working-bind-x@1.0.1(transitive)
+ Addedinfinity-x@2.2.1(transitive)
+ Addedis-array-x@2.1.2(transitive)
+ Addedis-finite-x@4.2.1(transitive)
+ Addedis-function-x@4.1.2(transitive)
+ Addedis-nan-x@2.1.1(transitive)
+ Addedis-nil-x@2.1.1(transitive)
+ Addedis-primitive-x@1.0.1(transitive)
+ Addedmath-sign-x@4.2.2(transitive)
+ Addednan-x@2.2.1(transitive)
+ Addednoop-x@1.2.1(transitive)
+ Addednormalize-space-x@4.1.2(transitive)
+ Addedparse-int-x@3.2.2(transitive)
+ Addedreplace-comments-x@3.1.2(transitive)
+ Addedrequire-coercible-to-string-x@2.1.1(transitive)
+ Addedrequire-object-coercible-x@2.1.1(transitive)
+ Addedsimple-bind-x@1.0.3(transitive)
+ Addedsimple-call-x@1.0.3(transitive)
+ Addedsimple-methodize-x@1.0.4(transitive)
+ Addedsplit-if-boxed-bug-x@2.1.2(transitive)
+ Addedto-boolean-x@2.1.1(transitive)
+ Addedto-integer-x@4.2.2(transitive)
+ Addedto-length-x@4.2.2(transitive)
+ Addedto-number-x@3.2.2(transitive)
+ Addedto-object-x@2.2.1(transitive)
+ Addedto-primitive-x@2.1.2(transitive)
+ Addedto-string-tag-x@2.1.2(transitive)
+ Addedto-string-x@2.1.1(transitive)
+ Addedtrim-left-x@4.1.2(transitive)
+ Addedtrim-right-x@4.1.2(transitive)
+ Addedtrim-x@4.1.2(transitive)
+ Addedutil-pusher-x@1.0.3(transitive)
+ Addedwhite-space-x@4.1.1(transitive)
- Removedarray-like-slice-x@1.2.0(transitive)
- Removedattempt-x@1.1.3(transitive)
- Removedcached-constructors-x@1.0.2(transitive)
- Removedhas-boxed-string-x@1.1.1(transitive)
- Removedhas-symbol-support-x@1.4.2(transitive)
- Removedhas-to-string-tag-x@1.4.1(transitive)
- Removedinfinity-x@1.0.2(transitive)
- Removedis-array-x@1.2.1(transitive)
- Removedis-falsey-x@1.0.3(transitive)
- Removedis-finite-x@3.0.4(transitive)
- Removedis-function-x@3.3.0(transitive)
- Removedis-nan-x@1.0.3(transitive)
- Removedis-nil-x@1.4.2(transitive)
- Removedis-primitive@2.0.0(transitive)
- Removedlodash.isnull@3.0.0(transitive)
- Removedmath-sign-x@3.0.0(transitive)
- Removedmax-safe-integer@1.0.1(transitive)
- Removednan-x@1.0.2(transitive)
- Removednormalize-space-x@3.0.0(transitive)
- Removedparse-int-x@2.0.0(transitive)
- Removedreplace-comments-x@2.0.0(transitive)
- Removedrequire-coercible-to-string-x@1.0.2(transitive)
- Removedrequire-object-coercible-x@1.4.3(transitive)
- Removedsplit-if-boxed-bug-x@1.1.1(transitive)
- Removedto-boolean-x@1.0.3(transitive)
- Removedto-integer-x@3.0.0(transitive)
- Removedto-length-x@3.0.0(transitive)
- Removedto-number-x@2.0.0(transitive)
- Removedto-object-x@1.5.0(transitive)
- Removedto-primitive-x@1.1.0(transitive)
- Removedto-string-tag-x@1.4.3(transitive)
- Removedto-string-x@1.4.5(transitive)
- Removedtrim-left-x@3.0.0(transitive)
- Removedtrim-right-x@3.0.0(transitive)
- Removedtrim-x@3.0.0(transitive)
- Removedvalidate.io-undefined@1.0.3(transitive)
- Removedwhite-space-x@3.0.1(transitive)
Updatedarray-like-slice-x@^2.0.2
Updatedattempt-x@^2.0.3
Updatedcached-constructors-x@^2.0.3
Updatedis-arguments@^1.0.4
Updatedis-array-x@^2.0.4
Updatedto-object-x@^2.0.0