Comparing version 0.0.16 to 0.0.17
{ | ||
"name": "advance", | ||
"version": "0.0.16", | ||
"version": "0.0.17", | ||
"author": "Alan Gutierrez <alan@prettyrobots.com>", | ||
@@ -5,0 +5,0 @@ "description": "In-memory forward iterator for use with the Strata b-tree MVCC tool collection.", |
In-memory forward iterator for use with the Strata b-tree MVCC tool collection. | ||
```javascript | ||
function comparator (a, b) { return +a - +b } | ||
var test = cadence(function () { | ||
var iterator | ||
async(function () { | ||
iterator = advance.forward(comparator, [ 1, 2, 3 ]) | ||
iterator.next(async()) | ||
}, function (more) { | ||
assert.ok(more) | ||
var items = [], item | ||
while (item = iterator.get()) { | ||
items.push(item) | ||
} | ||
assert.deepEqual(items, [ 1, 2, 3 ], 'next') | ||
iterator.next(async()) | ||
}, function (more) { | ||
assert.ok(!more) | ||
iterator.unlock(async()) | ||
}) | ||
}) | ||
test(function (error) { if (error) throw error }) | ||
``` |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
12517
27