Socket
Socket
Sign inDemoInstall

es-toolkit

Package Overview
Dependencies
Maintainers
0
Versions
722
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

es-toolkit - npm Package Compare versions

Comparing version 1.20.0-dev.648 to 1.20.0-dev.649

37

dist/function/curry.d.ts

@@ -51,14 +51,13 @@ /**

*
* @param {(p1: P1, p2: P2, p3: P3, p4: P4) => R} func - The function to curry.
* @returns {(p1: P1) => (p2: P2) => (p3: P3) => (p4: P4) => R} A curried function.
* @param {(p1: P1, p2: P2, p3: P3) => R} func - The function to curry.
* @returns {(p1: P1) => (p2: P2) => (p3: P3) => R} A curried function.
*
* @example
* function fourArgFunc(a: number, b: number, c: number, d: number) {
* return a + b + c + d;
* function threeArgFunc(a: number, b: number, c: number) {
* return a + b + c;
* }
* const curriedFourArgFunc = curry(fourArgFunc);
* const add1 = curriedFourArgFunc(1);
* const add2 = add1(2);
* const add3 = add2(3);
* console.log(add3(4)); // 10
* const curriedThreeArgFunc = curry(threeArgFunc);
* const add1 = curriedThreeArgFunc(1);
* const add3 = add1(2);
* console.log(add3(3)); // 6
*/

@@ -79,5 +78,5 @@ declare function curry<P1, P2, P3, R>(func: (p1: P1, p2: P2, p3: P3) => R): (p1: P1) => (p2: P2) => (p3: P3) => R;

* const add1 = curriedFourArgFunc(1);
* const add2 = add1(2);
* const add3 = add2(3);
* console.log(add3(4)); // 10
* const add3 = add1(2);
* const add6 = add3(3);
* console.log(add6(4)); // 10
*/

@@ -98,6 +97,6 @@ declare function curry<P1, P2, P3, P4, R>(func: (p1: P1, p2: P2, p3: P3, p4: P4) => R): (p1: P1) => (p2: P2) => (p3: P3) => (p4: P4) => R;

* const add1 = curriedFiveArgFunc(1);
* const add2 = add1(2);
* const add3 = add2(3);
* const add4 = add3(4);
* console.log(add4(5)); // 15
* const add3 = add1(2);
* const add6 = add3(3);
* const add10 = add6(4);
* console.log(add10(5)); // 15
*/

@@ -120,9 +119,9 @@ declare function curry<P1, P2, P3, P4, P5, R>(func: (p1: P1, p2: P2, p3: P3, p4: P4, p5: P5) => R): (p1: P1) => (p2: P2) => (p3: P3) => (p4: P4) => (p5: P5) => R;

* // The parameter `a` should be given the value `10`.
* const sum10 = curriedSum(10);
* const add10 = curriedSum(10);
*
* // The parameter `b` should be given the value `15`.
* const sum25 = sum10(15);
* const add25 = add10(15);
*
* // The parameter `c` should be given the value `5`. The function 'sum' has received all its arguments and will now return a value.
* const result = sum25(5);
* const result = add25(5);
*/

@@ -129,0 +128,0 @@ declare function curry(func: (...args: any[]) => any): (...args: any[]) => any;

{
"name": "es-toolkit",
"description": "A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.",
"version": "1.20.0-dev.648+60e4ba38",
"version": "1.20.0-dev.649+c9346d50",
"homepage": "https://es-toolkit.slash.page",

@@ -6,0 +6,0 @@ "bugs": "https://github.com/toss/es-toolkit/issues",

Sorry, the diff of this file is not supported yet

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