diff --git a/.babelrc b/.babelrc index 86a1a91..0558174 100644 --- a/.babelrc +++ b/.babelrc @@ -1,4 +1,3 @@ { - stage: "1", - loose: "all" + "presets": ["es2015", "stage-2"] } diff --git a/lib/is.js b/lib/is.js index 0e3eb6d..2551245 100644 --- a/lib/is.js +++ b/lib/is.js @@ -5,9 +5,9 @@ function is(path, predicate, object) { const parts = splitPath(path); let rest = object; - let part; - for (part of parts) { + for (let i = 0; i < parts.length; ++i) { if (typeof rest === 'undefined') return false; + const part = parts[i]; rest = rest[part]; } diff --git a/lib/util/curry.js b/lib/util/curry.js index 2f9157c..cc3f952 100644 --- a/lib/util/curry.js +++ b/lib/util/curry.js @@ -13,7 +13,8 @@ function countArguments(args, max) { } export function curry1(fn) { - return function curried(a, ...[b, c]) { + return function curried(a, ...args) { + const [b, c] = args; const n = countArguments(arguments); if (n >= 1) return fn(a, b, c); @@ -22,7 +23,8 @@ export function curry1(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); if (b === _ || c === _ || d === _) { @@ -40,7 +42,8 @@ export function curry2(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); if (c === _ || d === _ || e === _) { @@ -68,7 +71,8 @@ export function curry3(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); if (d === _ || e === _ || f === _) { diff --git a/package.json b/package.json index 0ed7c4d..d44867a 100644 --- a/package.json +++ b/package.json @@ -32,22 +32,22 @@ "lodash": "^3.0.0" }, "devDependencies": { - "babel": "^5.8.21", - "babel-core": "^5.5.0", - "babel-eslint": "^4.0.5", - "babel-loader": "^5.3.2", + "babel-core": "^6.4.0", + "babel-loader": "^6.2.1", + "babel-preset-es2015": "^6.3.13", + "babel-preset-stage-2": "^6.3.13", "benchmark": "^1.0.0", "chai": "^3.2.0", "eslint": "^0.24.1", "eslint-config-airbnb": "0.0.7", "exports-loader": "^0.6.2", "gulp": "^3.6.0", - "gulp-babel": "^5.1.0", + "gulp-babel": "^6.1.1", "gulp-eslint": "^0.15.0", "gulp-mocha": "^2.0.0", "gulp-nsp": "^2.0.0", "karma": "^0.13.3", - "karma-babel-preprocessor": "^5.2.1", + "karma-babel-preprocessor": "^6.0.1", "karma-chrome-launcher": "^0.2.0", "karma-mocha": "^0.2.0", "karma-mocha-reporter": "^1.0.4",