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

fn-compose

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fn-compose - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

2

package.json
{
"name": "fn-compose",
"version": "1.0.0",
"version": "1.0.1",
"description": "compose an arbitrary number of functions from right to left.",

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

@@ -18,7 +18,7 @@ fn-compose

var compose = require('fn-compose'),
add2 = function add2(a){ return a + 2 },
mul2 = function mul2(a){ return a * 2 },
sub1 = function sub1(a){ return a - 1 },
add2Sub1 = compose(sub1, add2);
mul2Sub1 = compose(sub1, mul2);
add2Sub1(5); //=> 6
mul2Sub1(5); //=> 9

@@ -25,0 +25,0 @@ ```

@@ -14,8 +14,8 @@ var test = require('tap').test,

t.plan(1);
var add = function add2(a){ return a + 2 },
var mul = function mul2(a){ return a * 2 },
sub = function sub1(a){ return a - 1 },
composed = compose(sub, add),
composed = compose(sub, mul),
result = composed(5);
t.equals(result, 6);
t.equals(result, 9);
});

@@ -25,10 +25,10 @@

t.plan(1);
var add = function add2(a){ return a + 2 },
var mul = function mul2(a){ return a * 2 },
sub = function sub1(a){ return a - 1 },
composed = compose(add, sub, add),
composed = compose(mul, sub, mul),
result = composed(5);
t.equals(result, 8);
t.equals(result, 18);
})
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