1.0.2 • Published 5 years ago

sort-with-exclusions v1.0.2

Weekly downloads
112
License
MIT
Repository
github
Last release
5 years ago

Sort with exclusions

Allows you to sort an array while using a callback to determine which elements to exclude. Uses Array.sort under the hood. No external dependencies.

Example

  const sortWithExclusions = require('sort-with-exclusions');
  
  sortWithExclusions([3, 2, 1], value => value === 3); // => [3, 1, 2]
  
  // Using an Array.sort comparison function
  sortWithExclusions([3, 2, 1], value => value == 1, (a, b) => a - b); // => [2, 3, 1]

Installation

$ npm install sort-with-exclusions

License

MIT © Andy Hansen

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago