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

curri

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

curri - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

40

curri.js
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global.curri = factory());
}(this, (function () { 'use strict';
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global = global || self, global.curri = factory());
}(this, function () { 'use strict';
/**
* Function to curry any javascript method
* @param {Function} fn - the target function we want to curry
* @param {...[args]} acc - initial arguments
* @returns {Function|*} it will return a function until the target function
* will receive all of its arguments
*/
function curry(fn, ...acc) {
return (...args) => {
args = [...acc, ...args];
/**
* Function to curry any javascript method
* @param {Function} fn - the target function we want to curry
* @param {...[args]} acc - initial arguments
* @returns {Function|*} it will return a function until the target function
* will receive all of its arguments
*/
function curry(fn, ...acc) {
return (...args) => {
args = [...acc, ...args];
return args.length < fn.length ?
curry(fn, ...args) :
fn(...args)
return args.length < fn.length ?
curry(fn, ...args) :
fn(...args)
}
}
}
return curry;
return curry;
})));
}));
{
"name": "curri",
"version": "1.0.0",
"version": "1.0.1",
"description": "Minimal curry implementation",

@@ -16,3 +16,2 @@ "main": "curri.js",

"files": [
"index.js",
"index.next.js"

@@ -25,4 +24,5 @@ ],

"keywords": [
"es6",
"es2015"
"curry",
"currying",
"functional"
],

@@ -36,7 +36,7 @@ "author": "Gianluca Guarini <gianluca.guarini@gmail.com> (http://gianlucaguarini.com)",

"devDependencies": {
"@gianlucaguarini/eslint-config": "^1.0.0",
"eslint": "^4.13.1",
"mocha": "^4.0.1",
"rollup": "^0.52.1"
"@gianlucaguarini/eslint-config": "^2.0.0",
"eslint": "^5.16.0",
"mocha": "^6.0.2",
"rollup": "^1.7.4"
}
}
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