New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

array-order

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

array-order - npm Package Compare versions

Comparing version 0.7.0 to 0.8.0

.eslintrc.json

8

CHANGELOG.md

@@ -11,2 +11,10 @@ <!-- markdownlint-disable MD022 MD024 MD026 MD032 MD041 -->

## [0.8.0] - 2020-04-25
### Added
- heap permutations
- more tests with permutations
### Changed
- simplified sort
## [0.7.0] - 2017-03-19

@@ -13,0 +21,0 @@ ### Changed

16

package.json
{
"name": "array-order",
"version": "0.7.0",
"version": "0.8.0",
"type": "module",
"description": "sort an array in-place to a preset order",

@@ -13,9 +14,8 @@ "keywords": [

"author": "Hugo Villeneuve",
"main": "./index.js",
"dependencies": {},
"main": "./sort.js",
"devDependencies": {
"cotest": "^2.1.0"
"@types/node": "^13.13.2"
},
"scripts": {
"test": "node test"
"test": "node ./tst/test-heap && node ./tst/test-sort"
},

@@ -26,7 +26,3 @@ "repository": {

},
"private": false,
"license": "MIT",
"publishConfig": {
"registry": "https://registry.npmjs.org/"
}
"license": "MIT"
}

@@ -7,2 +7,4 @@ <!-- markdownlint-disable MD004 MD007 MD010 MD012 MD041 MD022 MD024 MD032 MD036 -->

## example
```javascript

@@ -16,6 +18,12 @@ var arrayOrder = require('array-order'),

The function will throw if the lengths don't match or if the order contains duplicate (`[0,2,0]`) or invalid (`[9,'a',3]`) indices
## other exported utils
the following are needed for testing and are also available
* `array-order/heap.js` creates a function that generates every permutations `(a:Array) => () => a:Array`
* `array-order/swap.js` in place swap of 2 items `(a:Array, i:number, j:number) => a:Array`
* `array-order/shift.js` in place left-swap from i to j `(a:Array, i:number, j:number) => a:Array`
## License
[MIT](http://www.opensource.org/licenses/MIT) © [Hugo Villeneuve](https://github.com/hville)
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc