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

pull-stream

Package Overview
Dependencies
Maintainers
1
Versions
87
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pull-stream - npm Package Compare versions

Comparing version 2.26.1 to 2.27.0

2

package.json
{
"name": "pull-stream",
"description": "minimal pull stream",
"version": "2.26.1",
"version": "2.27.0",
"homepage": "https://github.com/dominictarr/pull-stream",

@@ -6,0 +6,0 @@ "repository": {

@@ -7,6 +7,13 @@

function abortCb(cb, abort, onAbort) {
cb(abort)
onAbort && onAbort(abort === true ? null: abort)
return
}
var once = exports.once =
function (value) {
function (value, onAbort) {
return function (abort, cb) {
if(abort) return cb(abort)
if(abort)
return abortCb(cb, abort, onAbort)
if(value != null) {

@@ -21,6 +28,7 @@ var _value = value; value = null

var values = exports.values = exports.readArray =
function (array) {
function (array, onAbort) {
if(!array)
return function (abort, cb) {
return cb(abort || true)
if(abort) return abortCb(cb, abort, onAbort)
return cb(true)
}

@@ -32,5 +40,5 @@ if(!Array.isArray(array))

var i = 0
return function (end, cb) {
if(end)
return cb && cb(end)
return function (abort, cb) {
if(abort)
return abortCb(cb, abort, onAbort)
cb(i >= array.length || null, array[i++])

@@ -37,0 +45,0 @@ }

@@ -28,1 +28,21 @@

})
tape('values, abort', function (t) {
t.plan(3)
var err = new Error('intentional')
var read = pull.values([1,2,3], function (err) {
t.end()
})
read(null, function (_, one) {
t.notOk(_)
t.equal(one, 1)
read(err, function (_err) {
t.equal(_err, err)
})
})
})
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