Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

keydir

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

keydir - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

13

keydir.js

@@ -44,5 +44,3 @@ var ltgt = require('ltgt')

Keydir.prototype.range = function (options) {
options = options || {}
Keydir.prototype._rangeIndexes = function (options) {
var lowerBound = ltgt.lowerBound(options)

@@ -55,3 +53,2 @@ , fromIdx = lowerBound ?

this._sortedIndexOf(upperBound) + 1 : this._keys.length
, keys

@@ -75,5 +72,11 @@ if (ltgt.lowerBoundExclusive(options) && this._keys[fromIdx] === lowerBound)

}
return { from: fromIdx, to: toIdx }
}
keys = this._keys.slice(fromIdx, toIdx)
Keydir.prototype.range = function (options) {
options = options || {}
var indexes = this._rangeIndexes(options)
, keys = this._keys.slice(indexes.from, indexes.to)
if (options.reverse)

@@ -80,0 +83,0 @@ keys = keys.reverse()

{
"name": "keydir",
"version": "1.0.1",
"version": "1.0.2",
"description": "A sorted list of keys with support for level-* ranges",

@@ -5,0 +5,0 @@ "main": "keydir.js",

@@ -9,2 +9,6 @@ # keydir[![build status](https://secure.travis-ci.org/kesla/keydir.svg)](http://travis-ci.org/kesla/keydir)

## Kudos
The starting point for this module was extracted from the memdown-module (https://npmjs.org/package/memdown).
## Installation

@@ -11,0 +15,0 @@

@@ -89,2 +89,7 @@ var test = require('tape')

t.deepEqual(
dir.range({ limit: -1 })
, [ 'foo1', 'foo2', 'foo3', 'foo4', 'foo5' ]
)
t.deepEqual(
dir.range({ reverse: true })

@@ -91,0 +96,0 @@ , [ 'foo5', 'foo4', 'foo3', 'foo2', 'foo1' ]

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