8000 GitHub - dominictarr/level-fix-range: use https://github.com/dominictarr/ltgt instead · GitHub
[go: up one dir, main page]

Skip to content

About

use https://github.com/dominictarr/ltgt instead

Resources

Stars

5 stars

Watchers

1 watching

Forks

Latest commit

 

History

29 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

level-fix-range

make reverse ranges easier to use.

this module is deprecated in favor of ltgt

Stability

Stable: Expect patches, possible features additions.

Example

When you use reverse ranges, you have to reverse the start and end also,

db.createReadStream({start: 'a', end: 'z'})
db.createReadStream({start: 'z', end: 'a', reverse: true})

this is confusing and bug-ridden.

level-fix-range fixes the options so they always make sense. if you want 62CD a range to reverse, just set reverse.

var fix = require('level-fix-range')
db.createReadStream({start: 'a', end: 'z'})
db.createReadStream(fix({start: 'a', end: 'z', reverse: true}))

When you either start OR end, and you specify reverse: true, it will also reverse the range, so that:

{start: X, end: null} //from X to end of database
{start: null, end: X} //from start of database to X

and you will get the same data, whether you have reverse: true or reverse: false, and only the order will change.

License

MIT

About

use https://github.com/dominictarr/ltgt instead

Resources

Stars

5 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages

0