
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
chickencurry
Advanced tools
Add some chickencurry to your functions
npm install chickencurry
var curry = require('chickencurry');
function add(a, b) {
return a + b;
}
var add1 = curry(add, 1);
var add12 = curry(add, 1, 2);
add1(3); // => 4
add12(); // => 3
You can curry a function and define the arguments for the curryied functions later.
function add(a, b) {
return a + b;
}
var curryiedAdd = curry(add); // no arguments passed to curry
var add1 = curryiedAdd(1);
var add2 = curryiedAdd(2);
add1(3); // => 4
add2(3); // => 5
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 __ = curry.__;
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'
If you want to curry a method of an object you have to bind the scope to the function.
var obj = {
name: 'stoeffel',
myFunc: function(arg) {
return arg + this.name;
}
};
var myFunc = curry(obj.myFunc.bind(obj), 'Hello ');
myFunc(); // => 'Hello stoeffel'
FAQs
Add some chicken curry to your functions
The npm package chickencurry receives a total of 353 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.