Skip to content

Commit

Permalink
chore(package) v2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
coderaiser committed Nov 23, 2016
1 parent 1cea228 commit 7ee0aff
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 44 deletions.
16 changes: 16 additions & 0 deletions ChangeLog
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

1 change: 0 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"name": "currify",
"version": "1.0.0",
"description": "translate the evaluation of a function that takes multiple arguments into evaluating a sequence of functions, each with a single or more arguments",
"homepage": "https://github.com/coderaiser/currify",
"authors": [
Expand Down
27 changes: 0 additions & 27 deletions dist/currify.es6.js

This file was deleted.

44 changes: 30 additions & 14 deletions dist/currify.js
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")
});
1 change: 0 additions & 1 deletion dist/currify.min.js
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")});
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "currify",
"version": "1.0.0",
"version": "2.0.0",
"description": "translate the evaluation of a function that takes multiple arguments into evaluating a sequence of functions, each with a single or more arguments",
"main": "lib/currify.js",
"scripts": {
Expand Down

0 comments on commit 7ee0aff

Please sign in to comment.