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

advance

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

advance - npm Package Compare versions

Comparing version 0.0.12 to 0.0.13

16

advance.js

@@ -1,4 +0,4 @@

function Forward (array) {
function Forward (array, index) {
this._array = array
this._index = 0
this._index = index == null ? 0 : index
}

@@ -22,9 +22,9 @@

exports.forward = function (array) {
return new Forward(array)
exports.forward = function (array, index) {
return new Forward(array, index)
}
function Reverse (array) {
function Reverse (array, index) {
this._array = array
this._index = array.length - 1
this._index = index == null ? array.length - 1 : index
}

@@ -48,4 +48,4 @@

exports.reverse = function (array) {
return new Reverse(array)
exports.reverse = function (array, index) {
return new Reverse(array, index)
}
{
"name": "advance",
"version": "0.0.12",
"version": "0.0.13",
"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.",

@@ -1,7 +0,9 @@

require('proof')(3, require('cadence/redux')(prove))
require('proof')(6, require('cadence/redux')(prove))
function prove (async, assert) {
var values = [ 'a', 'b', 'c' ]
var iterator = require('../..').forward(values)
var advance = require('../..')
var iterator
async(function () {
iterator = advance.forward(values)
iterator.next(async())

@@ -20,3 +22,18 @@ }, function (more) {

iterator.unlock(async())
}, function () {
iterator = advance.forward(values, 1)
iterator.next(async())
}, function (more) {
assert(more, 'more')
var items = [], item
while (item = iterator.get()) {
items.push(item)
}
assert(items, [ 'b', 'c' ], 'next with index')
iterator.next(async())
}, function (more) {
assert(!more, 'no more with index')
}, function () {
iterator.unlock(async())
})
}

@@ -1,7 +0,9 @@

require('proof')(3, require('cadence/redux')(prove))
require('proof')(6, require('cadence/redux')(prove))
function prove (async, assert) {
var values = [ 'a', 'b', 'c' ]
var iterator = require('../..').reverse(values)
var advance = require('../..')
var iterator
async(function () {
iterator = advance.reverse(values)
iterator.next(async())

@@ -20,3 +22,18 @@ }, function (more) {

iterator.unlock(async())
}, function () {
iterator = advance.reverse(values, 1)
iterator.next(async())
}, function (more) {
assert(more, 'more')
var items = [], item
while (item = iterator.get()) {
items.push(item)
}
assert(items, [ 'b', 'a' ], 'next with index')
iterator.next(async())
}, function (more) {
assert(!more, 'no more with index')
}, function () {
iterator.unlock(async())
})
}

Sorry, the diff of this file is not supported yet

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