Socket
Socket
Sign inDemoInstall

map-filter-reduce

Package Overview
Dependencies
4
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.0.1 to 3.0.2

24

index.js

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

var pull = require('pull-stream')
var pull = require('pull-stream/pull')
var pullFilter = require('pull-stream/throughs/filter')
var pullFlatten = require('pull-stream/throughs/flatten')
var pullMap = require('pull-stream/throughs/map')
var pullReduce = require('pull-stream/sinks/reduce')

@@ -21,2 +25,8 @@ var make = require('./make')

function passSync(fn) {
return function (data) {
return data.sync ? data : fn(data)
}
}
exports = module.exports = function (q, cb) {

@@ -37,7 +47,7 @@ q = q.filter(Boolean)

exports.filter = function (q) {
return pull.filter(make(q))
return pullFilter(passSync(make(q)))
}
exports.map = function (q) {
return pull(pull.map(make(q)),pull.filter())
return pull(pullMap(passSync(make(q))), pullFilter())
}

@@ -48,6 +58,6 @@

if(cb)
return pull.reduce(make(q), null, cb)
return pullReduce(make(q), null, cb)
return pull(SinkThrough(function (cb) {
return pull.reduce(make(q), null, cb)
}), pull.flatten())
return pullReduce(make(q), null, cb)
}), pullFlatten())
}

@@ -57,1 +67,3 @@

{
"name": "map-filter-reduce",
"description": "",
"version": "3.0.1",
"version": "3.0.2",
"homepage": "https://github.com/dominictarr/map-filter-reduce",

@@ -13,3 +13,3 @@ "repository": {

"pull-sink-through": "0.0.0",
"pull-stream": "^3.3.0",
"pull-stream": "^3.4.3",
"typewiselite": "^1.0.0"

@@ -16,0 +16,0 @@ },

@@ -17,3 +17,6 @@ var tape = require('tape')

{source: 'b', dest: 'a', rel: ['name', '@alice']},
{source: 'b', dest: 'a', rel: ['contact', true, false]}
{source: 'b', dest: 'a', rel: ['contact', true, false]},
{source: 'b', dest: 'a', rel: ['contact', false, null]},
true,
false
]

@@ -28,3 +31,5 @@

{rel: ['name', {$prefix: '@b'}]},
{rel: {$prefix: ['contact', true]}}
{rel: {$prefix: ['contact', true]}},
{rel: ['contact', {$is: 'boolean'}]},
{$is: 'boolean'}
]

@@ -42,3 +47,8 @@

[{source: 'a', dest: 'b', rel: ['name', '@bob']}],
[{source: 'b', dest: 'a', rel: ['contact', true, false]}]
[{source: 'b', dest: 'a', rel: ['contact', true, false]}],
[
{source: 'b', dest: 'a', rel: ['contact', true, false]},
{source: 'b', dest: 'a', rel: ['contact', false, null]}
],
[true, false]
]

@@ -64,1 +74,3 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc