Socket
Book a DemoInstallSign in
Socket

fj-pipe

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fj-pipe - npm Package Compare versions

Comparing version

to
1.1.0

21

index.js
"use strict";
var pipe = exports.pipe = function () {
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
var compose = _interopRequire(require("fj-compose"));
var pipe = function () {
for (var _len = arguments.length, fns = Array(_len), _key = 0; _key < _len; _key++) {

@@ -8,14 +12,5 @@ fns[_key] = arguments[_key];

return fns.reduce(function (f, g) {
return function () {
for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
args[_key2] = arguments[_key2];
}
return compose.apply(null, fns.reverse());
};
return f(g.apply(null, args));
};
});
};
Object.defineProperty(exports, "__esModule", {
value: true
});
module.exports = pipe;
{
"name": "fj-pipe",
"version": "1.0.4",
"version": "1.1.0",
"description": "Pipe functions, FP style.",

@@ -35,3 +35,6 @@ "main": "index.js",

"mochify": "^2.2.0"
},
"dependencies": {
"fj-compose": "^1.1.0"
}
}
"use strict";
var _interopRequire = function (obj) {
return obj && (obj["default"] || obj);
};
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
var assert = _interopRequire(require("assert"));
var pipe = require("./").pipe;
var pipe = _interopRequire(require("./"));
var add1 = function (x) {
return x + 1;
}, mult2 = function (x) {
},
mult2 = function (x) {
return x * 2;
}, square = function (x) {
},
square = function (x) {
return x * x;
};
var pipe1 = pipe(add1), pipe2 = pipe(add1, mult2), pipe3 = pipe(add1, mult2, square);
var pipe1 = pipe(add1),
pipe2 = pipe(add1, mult2),
pipe3 = pipe(add1, mult2, square);

@@ -25,4 +26,4 @@

assert.equal(pipe1(0), 1);
assert.equal(pipe2(1), 3);
assert.equal(pipe3(1), 3);
});
assert.equal(pipe2(1), 4);
assert.equal(pipe3(1), 16);
});

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.