Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@blakek/curry

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@blakek/curry - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

2

package.json
{
"name": "@blakek/curry",
"version": "2.0.1",
"version": "2.0.2",
"main": "dist/curry.cjs.js",

@@ -5,0 +5,0 @@ "module": "dist/curry.esm.js",

@@ -5,4 +5,8 @@ # curry

A simple helper to help apply arguments to a function over time.
A simple helper to wrap a function and gradually accept (i.e. partially apply)
arguments.
This package is technically a helper partial application, but `curry` is much
easier to remember and a nicer package function name than `partiallyApply`.
## Install

@@ -43,2 +47,21 @@

### TypeScript
The types of many functions are inferred. However, some functions, such as
variadic functions, need an explicit type:
```ts
const add = (...args: number[]) => args.reduce((a, b) => a + b, 0);
const addFourItems = curry(add, 4) as VariadicCurry<
// argument types
[number, number, number, number],
// return type
number
>;
// Includes helpers for functions accepting <=5 args
const addTwo = curry(add, 2) as Curry2<number, number, number>;
```
## API

@@ -52,4 +75,4 @@

Returns functions that take in the arguments of another function until all have
been provided.
Returns functions that take in the arguments of a function until all have been
provided.

@@ -64,4 +87,6 @@ ### `curryRight`

Provided for the common use-case of needing to supply context-specific arguments
before providing the first arguments. For example:
before providing the first arguments.
For example:
```js

@@ -68,0 +93,0 @@ import { curryRight } from '@blakek/curry';

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