Gathering detailed insights and metrics for @ngard/tiny-curry
Gathering detailed insights and metrics for @ngard/tiny-curry
Gathering detailed insights and metrics for @ngard/tiny-curry
Gathering detailed insights and metrics for @ngard/tiny-curry
A minimal-weight currying utility similar to lodash.curry
npm install @ngard/tiny-curry
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
1 Stars
4 Commits
1 Branches
1 Contributors
Updated on Aug 28, 2019
Latest Version
1.0.1
Package Id
@ngard/tiny-curry@1.0.1
Unpacked Size
16.91 kB
Size
6.17 kB
File Count
7
NPM Version
6.5.0
Node Version
10.14.1
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
A minimal utility similar to lodash.curry
. For when every byte counts!
Returns a series of functions that consume the original function's arguments one at a time until the original function's arity (or the passed arity) is met.
1npm install @ngard/tiny-curry
1curry(/* function [, arity] */);
function
- A function that will be called once the parameters are gathered through currying.
arity
- The number of curry functions to create before returning the result of the passed function called with the arguments. Defaults to function.length
.
A series of functions that each take a single argument and apply those arguments to the supplied function once they have all been gathered. Each intermediate function also has a value
method that may be invoked to apply the currently gathered arguments to the function.
1import { curry } from '@ngard/tiny-curry'; 2 3function add(a, b) { return a + b; } 4// add.length = 2, the number of arguments it expects 5 6const curriedAdd = curry(add); 7const addTwo = curriedAdd(2); 8 9console.log(addTwo(5)); // logs '7'
1import { curry } from '@ngard/tiny-curry'; 2 3function greet(name, title = 'Your Lordship') { 4 return `Good day, ${name}, ${title}`; 5} 6// greet.length = 1, because defaulted arguments are not 'expected' 7 8const curriedGreet = curry(greet, 2); 9const greetBob = curriedGreet('Bob'); 10 11console.log(greetBob('my friend')); // logs 'Good day, Bob, my friend' 12console.log(greetBob()); // logs 'Good day, Bob, Your Lordship'
1import { curry } from '@ngard/tiny-curry'; 2 3function sum(...numbers) { 4 return numbers.reduce((total, number) => total + number); 5} 6// sum.length = 0, because rest arguments are not 'expected' 7 8const curriedSum = curry(sum, Infinity); 9 10// call `.value()` on an infinitely curried function to call the 11// original function with the gathered arguments 12const total = curriedSum(1)(2)(3)(4).value(); 13 14console.log(total); // logs '10'
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
8 existing vulnerabilities detected
Details
Reason
Found 0/4 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-07-14
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More