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

promise.pipe

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

promise.pipe - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

5

index.js
module.exports = pipe
function pipe () {
var args = [].slice.apply(arguments)
if (!arguments.length) throw new Error('pipe requires one or more arguments')
var args = Array.isArray(arguments[0])
? arguments[0]
: [].slice.apply(arguments)
return reduce(kestrel, args[0], rest(args))

@@ -7,0 +10,0 @@ }

2

package.json
{
"name": "promise.pipe",
"version": "1.0.1",
"version": "1.0.2",
"description": "Performs left to right composition of one or more functions whom return promises",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -26,3 +26,3 @@ # promise-pipe

#### `pipe(functions...)` -> `promise`
#### `pipe(Array<Function<Promise>>, or Function<Promise>)` -> `promise`

@@ -29,0 +29,0 @@ Runs multiple promise-returning functions in a series, passing each result to the next defined promise-returning function.

@@ -73,2 +73,11 @@ var test = require('blue-tape')

test('it should accept an array of promises', function (t) {
var addThreeAsync = pipe([addAsync, addAsync, addAsync])
t.ok(addThreeAsync)
return addThreeAsync(0).then(function (result) {
t.equal(result, 3)
})
})
test('it should fail with 0 arguments', function (t) {

@@ -75,0 +84,0 @@ try { pipe() } catch (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