abstract-leveldown
Advanced tools
Comparing version 4.0.1 to 4.0.2
@@ -17,7 +17,9 @@ /* Copyright (c) 2017 Rod Vagg, MIT License */ | ||
if (self._ended) { | ||
return process.nextTick(callback, new Error('cannot call next() after end()')) | ||
process.nextTick(callback, new Error('cannot call next() after end()')) | ||
return self | ||
} | ||
if (self._nexting) { | ||
return process.nextTick(callback, new Error('cannot call next() before previous next() has completed')) | ||
process.nextTick(callback, new Error('cannot call next() before previous next() has completed')) | ||
return self | ||
} | ||
@@ -30,2 +32,4 @@ | ||
}) | ||
return self | ||
} | ||
@@ -32,0 +36,0 @@ |
@@ -43,2 +43,9 @@ var db | ||
}) | ||
test('test iterator#next returns this', function (t) { | ||
var iterator = db.iterator() | ||
var self = iterator.next(function () {}) | ||
t.ok(iterator === self) | ||
iterator.end(t.end.bind(t)) | ||
}) | ||
} | ||
@@ -45,0 +52,0 @@ |
@@ -5,2 +5,7 @@ # Changelog | ||
## [4.0.2] - 2018-02-09 | ||
### Fixed | ||
* Fix `iterator#next` to return `this` (@vweevers) | ||
## [4.0.1] - 2018-02-09 | ||
@@ -532,3 +537,4 @@ | ||
[Unreleased]: https://github.com/level/abstract-leveldown/compare/v4.0.1...HEAD | ||
[Unreleased]: https://github.com/level/abstract-leveldown/compare/v4.0.2...HEAD | ||
[4.0.2]: https://github.com/level/abstract-leveldown/compare/v4.0.1...v4.0.2 | ||
[4.0.1]: https://github.com/level/abstract-leveldown/compare/v4.0.0...v4.0.1 | ||
@@ -535,0 +541,0 @@ [4.0.0]: https://github.com/level/abstract-leveldown/compare/v3.0.0...v4.0.0 |
@@ -58,3 +58,3 @@ interface AbstractLevelDOWN<K=any, V=any, O=any, PO=any, GO=any, DO=any, IO=any, BO=any> { | ||
db: any; | ||
next(callback: (err: any, key: K, value: V) => void): void; | ||
next(callback: (err: any, key: K, value: V) => void): this; | ||
end(callback: (err: any) => void): void; | ||
@@ -61,0 +61,0 @@ } |
{ | ||
"name": "abstract-leveldown", | ||
"description": "An abstract prototype matching the LevelDOWN API", | ||
"version": "4.0.1", | ||
"version": "4.0.2", | ||
"contributors": [ | ||
@@ -6,0 +6,0 @@ "Rod Vagg <r@va.gg> (https://github.com/rvagg)", |
@@ -22,1 +22,6 @@ import { AbstractLevelDOWN } from '.' | ||
new AbstractLevelDOWN('loc').get(buf, (err: Error, value: any) => {}) | ||
// Test that iterator.next() returns this | ||
const db = new AbstractLevelDOWN('loc') | ||
const iterator = db.iterator().next(function (err: Error, key: any, value: any) {}) | ||
iterator.end(function (err: Error) {}) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
128267
2745