Upgrade to babel 6
This commit is contained in:
parent
3507412814
commit
a0a4e04f30
3
.babelrc
3
.babelrc
@ -1,4 +1,3 @@
|
|||||||
{
|
{
|
||||||
stage: "1",
|
"presets": ["es2015", "stage-2"]
|
||||||
loose: "all"
|
|
||||||
}
|
}
|
||||||
|
@ -5,9 +5,9 @@ function is(path, predicate, object) {
|
|||||||
const parts = splitPath(path);
|
const parts = splitPath(path);
|
||||||
|
|
||||||
let rest = object;
|
let rest = object;
|
||||||
let part;
|
for (let i = 0; i < parts.length; ++i) {
|
||||||
for (part of parts) {
|
|
||||||
if (typeof rest === 'undefined') return false;
|
if (typeof rest === 'undefined') return false;
|
||||||
|
const part = parts[i];
|
||||||
rest = rest[part];
|
rest = rest[part];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,7 +13,8 @@ function countArguments(args, max) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function curry1(fn) {
|
export function curry1(fn) {
|
||||||
return function curried(a, ...[b, c]) {
|
return function curried(a, ...args) {
|
||||||
|
const [b, c] = args;
|
||||||
const n = countArguments(arguments);
|
const n = countArguments(arguments);
|
||||||
|
|
||||||
if (n >= 1) return fn(a, b, c);
|
if (n >= 1) return fn(a, b, c);
|
||||||
@ -22,7 +23,8 @@ export function curry1(fn) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function curry2(fn) {
|
export function curry2(fn) {
|
||||||
return function curried(a, b, ...[c, d]) {
|
return function curried(a, b, ...args) {
|
||||||
|
const [c, d] = args;
|
||||||
const n = countArguments(arguments, 2);
|
const n = countArguments(arguments, 2);
|
||||||
|
|
||||||
if (b === _ || c === _ || d === _) {
|
if (b === _ || c === _ || d === _) {
|
||||||
@ -40,7 +42,8 @@ export function curry2(fn) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function curry3(fn) {
|
export function curry3(fn) {
|
||||||
return function curried(a, b, c, ...[d, e]) {
|
return function curried(a, b, c, ...args) {
|
||||||
|
const [d, e] = args;
|
||||||
const n = countArguments(arguments, 3);
|
const n = countArguments(arguments, 3);
|
||||||
|
|
||||||
if (c === _ || d === _ || e === _) {
|
if (c === _ || d === _ || e === _) {
|
||||||
@ -68,7 +71,8 @@ export function curry3(fn) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function curry4(fn) {
|
export function curry4(fn) {
|
||||||
return function curried(a, b, c, d, ...[e, f]) {
|
return function curried(a, b, c, d, ...args) {
|
||||||
|
const [e, f] = args;
|
||||||
const n = countArguments(arguments, 4);
|
const n = countArguments(arguments, 4);
|
||||||
|
|
||||||
if (d === _ || e === _ || f === _) {
|
if (d === _ || e === _ || f === _) {
|
||||||
|
12
package.json
12
package.json
@ -32,22 +32,22 @@
|
|||||||
"lodash": "^3.0.0"
|
"lodash": "^3.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"babel": "^5.8.21",
|
"babel-core": "^6.4.0",
|
||||||
"babel-core": "^5.5.0",
|
"babel-loader": "^6.2.1",
|
||||||
"babel-eslint": "^4.0.5",
|
"babel-preset-es2015": "^6.3.13",
|
||||||
"babel-loader": "^5.3.2",
|
"babel-preset-stage-2": "^6.3.13",
|
||||||
"benchmark": "^1.0.0",
|
"benchmark": "^1.0.0",
|
||||||
"chai": "^3.2.0",
|
"chai": "^3.2.0",
|
||||||
"eslint": "^0.24.1",
|
"eslint": "^0.24.1",
|
||||||
"eslint-config-airbnb": "0.0.7",
|
"eslint-config-airbnb": "0.0.7",
|
||||||
"exports-loader": "^0.6.2",
|
"exports-loader": "^0.6.2",
|
||||||
"gulp": "^3.6.0",
|
"gulp": "^3.6.0",
|
||||||
"gulp-babel": "^5.1.0",
|
"gulp-babel": "^6.1.1",
|
||||||
"gulp-eslint": "^0.15.0",
|
"gulp-eslint": "^0.15.0",
|
||||||
"gulp-mocha": "^2.0.0",
|
"gulp-mocha": "^2.0.0",
|
||||||
"gulp-nsp": "^2.0.0",
|
"gulp-nsp": "^2.0.0",
|
||||||
"karma": "^0.13.3",
|
"karma": "^0.13.3",
|
||||||
"karma-babel-preprocessor": "^5.2.1",
|
"karma-babel-preprocessor": "^6.0.1",
|
||||||
"karma-chrome-launcher": "^0.2.0",
|
"karma-chrome-launcher": "^0.2.0",
|
||||||
"karma-mocha": "^0.2.0",
|
"karma-mocha": "^0.2.0",
|
||||||
"karma-mocha-reporter": "^1.0.4",
|
"karma-mocha-reporter": "^1.0.4",
|
||||||
|
Loading…
Reference in New Issue
Block a user