level-fix-range

WebJar for level-fix-range

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

level-fix-range
Last Version

Last Version

1.0.2
Release Date

Release Date

Type

Type

jar
Description

Description

level-fix-range
WebJar for level-fix-range
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/dominictarr/level-fix-range

Download level-fix-range

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/level-fix-range/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>level-fix-range</artifactId>
    <version>1.0.2</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/level-fix-range/
implementation 'org.webjars.npm:level-fix-range:1.0.2'
// https://jarcasting.com/artifacts/org.webjars.npm/level-fix-range/
implementation ("org.webjars.npm:level-fix-range:1.0.2")
'org.webjars.npm:level-fix-range:jar:1.0.2'
<dependency org="org.webjars.npm" name="level-fix-range" rev="1.0.2">
  <artifact name="level-fix-range" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='level-fix-range', version='1.0.2')
)
libraryDependencies += "org.webjars.npm" % "level-fix-range" % "1.0.2"
[org.webjars.npm/level-fix-range "1.0.2"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

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 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

Versions

Version
1.0.2