Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
chickencurry
Advanced tools
Add some chickencurry to your functions
Library to curry a function. It supports auto rurrying, currying a number of arguments, placeholders and partial applications.
npm install chickencurry
var curry = require('chickencurry');
function add(a, b) {
return a + b;
}
var add1 = curry(add)(1);
add1(3); // => 4
add1(4); // => 5
::
(ES2015)var curry = require('./');
var add1 = function(a, b) {
return a + b;
}::curry(1);
add1(3); // => 4
add1(4); // => 5
var sub = function(a, b) {
return a - b;
}::curry();
sub(3)(1); // => 2
var curryN = require('chickencurry/N');
function join() {
return Array.prototype.slice.call(arguments).join(',');
}
curryN(join, 3)(1)(2)(3) // => '1,2,3'
var curry1 = require('chickencurry/1');
var curry2 = require('chickencurry/2');
var curry3 = require('chickencurry/3');
curry1(join)(1) // => '1'
curry2(join)(1)(2) // => '1,2'
curry3(join)(1)(2)(3) // => '1,2,3'
var curryN = require('chickencurry/N');
function join() {
return Array.prototype.slice.call(arguments).join(',');
}
curryN(join, 3, 'Fish', 'Chicken')('...'); // => 'Fish,Chicken,...')
curryN(join, 3)('Fish', 'Chicken')('...'); // => 'Fish,Chicken,...')
You can curry a function using placeholders, if you want to set the i.e 3rd argument.
function join(a, b, sep) {
return a + sep + b;
};
var __ = require('chickencurry/__');
var join_ = curry(join, __, __, '_');
// or var join_ = curry(join, undefined, undefined, '_');
join_('chicken', 'curry'); // => 'chicken_curry'
var joinCurry = curry(join);
var joinDash = joinCurry(__, __, '-');
joinDash('chicken', 'curry'); // => 'chicken-curry'
FAQs
Add some chicken curry to your functions
The npm package chickencurry receives a total of 120 weekly downloads. As such, chickencurry popularity was classified as not popular.
We found that chickencurry demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.