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.9.2 to 2.10.0

test/take.js

2

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

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

@@ -13,6 +13,4 @@ function prop (map) {

var k = 0
var map = exports.map =
function (read, map) {
var _k = k++
map = prop(map) || id

@@ -75,20 +73,22 @@ return function (end, cb) {

function (read, test) {
var ended = false
var ended = false, more
if('number' === typeof test) {
var n = test; test = function () {
return n --> 0
return n --
}
}
return function (end, cb) {
if(ended = ended || end)
return read(ended, cb)
if(ended) return cb(ended)
if(1 === more) end = true
if(ended = end) return read(ended, cb)
read(null, function (end, data) {
if(ended = ended || end) return cb(ended)
//TODO, CHECK THAT END LOGIC IS CORRECT WITH TAKE!!!
if(!test(data)) {
if(!(more = test(data))) {
ended = true
read(true, cb)
read(true, function (end, data) {
cb(ended, data)
})
}
else
else
cb(null, data)

@@ -95,0 +95,0 @@ })

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