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.11 to 0.0.12

t/advance/reverse.t.js

37

advance.js

@@ -1,2 +0,2 @@

function Advance (array) {
function Forward (array) {
this._array = array

@@ -6,7 +6,7 @@ this._index = 0

Advance.prototype.get = function () {
Forward.prototype.get = function () {
return this._array[this._index++]
}
Advance.prototype.next = function (callback) {
Forward.prototype.next = function (callback) {
if (this._index >= this._array.length) {

@@ -19,8 +19,33 @@ callback(null, false)

Advance.prototype.unlock = function (callback) {
Forward.prototype.unlock = function (callback) {
callback()
}
module.exports = function (array) {
return new Advance(array)
exports.forward = function (array) {
return new Forward(array)
}
function Reverse (array) {
this._array = array
this._index = array.length - 1
}
Reverse.prototype.get = function () {
return this._array[this._index--]
}
Reverse.prototype.next = function (callback) {
if (this._index < 0) {
callback(null, false)
} else {
callback(null, true)
}
}
Reverse.prototype.unlock = function (callback) {
callback()
}
exports.reverse = function (array) {
return new Reverse(array)
}

4

package.json
{
"name": "advance",
"version": "0.0.11",
"version": "0.0.12",
"author": "Alan Gutierrez <alan@prettyrobots.com>",

@@ -30,3 +30,3 @@ "description": "In-memory forward iterator for use with the Strata b-tree MVCC tool collection.",

{
"proof": "0.0.50",
"proof": "0.0.51",
"cadence": "0.0.52"

@@ -33,0 +33,0 @@ },

@@ -5,3 +5,3 @@ require('proof')(3, require('cadence/redux')(prove))

var values = [ 'a', 'b', 'c' ]
var iterator = require('../..')(values)
var iterator = require('../..').forward(values)
async(function () {

@@ -8,0 +8,0 @@ iterator.next(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