diff --git a/.eslintrc.json b/.eslintrc.json index d055a5a..99be303 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,4 +1,5 @@ { + "parser": "babel-eslint", "env": { "browser": true, "es6": true, diff --git a/package.json b/package.json index d786537..d44d61a 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "constraint-validator", "main": "dist/constraint-validator.cjs.js", - "version": "1.0.8", + "version": "1.1.0", "description": "Constraint validation tool", "scripts": { "test": "NODE_PATH=./src mocha --require ./tests/bootstrap.js ./tests/**/*.spec.js", @@ -30,13 +30,14 @@ "@babel/register": "^7.11.5", "@rollup/plugin-commonjs": "^11.1.0", "@rollup/plugin-node-resolve": "^7.1.3", + "babel-eslint": "^10.1.0", "babel-plugin-add-module-exports": "^1.0.2", - "eslint": "^6.8.0", + "eslint": "^7.8.1", "jsdom": "^16.4.0", "jsdom-global": "^3.0.2", "mocha": "^7.2.0", "nyc": "^15.1.0", - "rollup": "^2.26.10", + "rollup": "^2.26.11", "rollup-plugin-babel": "^4.4.0", "rollup-plugin-sourcemaps": "^0.6.2", "rollup-plugin-terser": "^5.3.1" diff --git a/src/Utils/functions.js b/src/Utils/functions.js index fa94ed8..ef74ca0 100644 --- a/src/Utils/functions.js +++ b/src/Utils/functions.js @@ -141,7 +141,7 @@ export function trim(value) { */ export function pipe(functions = [], options = {}) { if (!isArray(functions)) { - throw new Error(`Functions list must be type of "array", "${typeof functions}" given.`) + throw new Error(`Functions list must be type of "array", "${typeof functions}" given.`); } functions = functions.filter(fn => isFunction(fn)); @@ -151,7 +151,6 @@ export function pipe(functions = [], options = {}) { return value; } - return functions.reduce(function (prev, fn) { return fn(prev, {...options, ...vOptions}); }, value);