find-insert-index
Find the index to insert an element in array keeping the sort order.
Last updated 7 years ago by jnuno .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install find-insert-index 
SYNC missed versions from official npm registry.

find-insert-index

Find the index to insert an element in array keeping the sort order.

Build Status

Example

var findInsertIndex, comparatorFn;
findInsertIndex = require('find-insert-index');
comparatorFn = function (a, b) {
  return a.id - b.id;
};

findInsertIndex(comparatorFn, [{id: 7}, {id: 8}], {id: 7});
// 1

Current Tags

  • 0.0.1                                ...           latest (7 years ago)

1 Versions

  • 0.0.1                                ...           7 years ago
Maintainers (1)
Downloads
Today 15
This Week 15
This Month 592
Last Day 7
Last Week 290
Last Month 579
Dependencies (0)
None
Dev Dependencies (2)

Copyright 2014 - 2016 © taobao.org |