-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1cea228
commit 7ee0aff
Showing
6 changed files
with
47 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
2016.11.23, v2.0.0 | ||
|
||
feature: | ||
- (travis) node_js: v6, v7 | ||
- (currify) fn.length in curried functions | ||
- (package) scripts: coverage | ||
- (gitignore) *.swp | ||
- (currify) es2015-ify | ||
- (package) redrun v5.0.0 | ||
- (package) redrun v4.0.0 | ||
- (package) npm-run-all -> redrun | ||
- (package) jscs v3.0.3 | ||
- (license) add | ||
- (gitignore) npm-debug.log -> npm-debug.log* | ||
- (package) browserify v13.0.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,42 @@ | ||
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.currify = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({"currify":[function(require,module,exports){ | ||
'use strict'; | ||
|
||
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } } | ||
const tail = list => [].slice.call(list, 1); | ||
const f = (fn) => [ | ||
function(a) { | ||
return fn(...arguments); | ||
}, | ||
function(a, b) { | ||
return fn(...arguments); | ||
}, | ||
function(a, b, c) { | ||
return fn(...arguments); | ||
} | ||
]; | ||
|
||
module.exports = currify; | ||
|
||
var tail = function tail(list) { | ||
return [].slice.call(list, 1); | ||
}; | ||
|
||
function currify(fn) { | ||
module.exports = function currify(fn) { | ||
check(fn); | ||
|
||
var args = tail(arguments); | ||
|
||
if (args.length >= fn.length) return fn.apply(undefined, _toConsumableArray(args));else return function () { | ||
return currify.apply(undefined, [fn].concat(_toConsumableArray(args), Array.prototype.slice.call(arguments))); | ||
|
||
const args = tail(arguments); | ||
|
||
if (args.length >= fn.length) | ||
return fn(...args); | ||
|
||
const again = function() { | ||
return currify(...[fn, ...args, ...arguments]); | ||
}; | ||
|
||
const count = fn.length - arguments.length; | ||
const func = f(again)[count]; | ||
|
||
return func; | ||
} | ||
|
||
function check(fn) { | ||
if (typeof fn !== 'function') throw Error('fn should be function!'); | ||
if (typeof fn !== 'function') | ||
throw Error('fn should be function!'); | ||
} | ||
|
||
|
||
},{}]},{},["currify"])("currify") | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +0,0 @@ | ||
!function(r){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=r();else if("function"==typeof define&&define.amd)define([],r);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.currify=r()}}(function(){return function r(e,n,t){function o(i,u){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!u&&c)return c(i,!0);if(f)return f(i,!0);var l=new Error("Cannot find module '"+i+"'");throw l.code="MODULE_NOT_FOUND",l}var a=n[i]={exports:{}};e[i][0].call(a.exports,function(r){var n=e[i][1][r];return o(n?n:r)},a,a.exports,r,e,n,t)}return n[i].exports}for(var f="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}({currify:[function(r,e){"use strict";function n(r){if(Array.isArray(r)){for(var e=0,n=Array(r.length);e<r.length;e++)n[e]=r[e];return n}return Array.from(r)}function t(r){o(r);var e=f(arguments);return e.length>=r.length?r.apply(void 0,n(e)):function(){return t.apply(void 0,[r].concat(n(e),Array.prototype.slice.call(arguments)))}}function o(r){if("function"!=typeof r)throw Error("fn should be function!")}e.exports=t;var f=function(r){return[].slice.call(r,1)}},{}]},{},["currify"])("currify")}); | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters