From 2732eaaa6ea1479d143c25e32994c9725c3d1b78 Mon Sep 17 00:00:00 2001 From: mohemohe Date: Tue, 12 Nov 2019 12:38:38 +0900 Subject: [PATCH] close #1 --- index.js | 4 +- lib/match/errorFactory.js | 8 +- lib/match/matchRule.js | 2 +- lib/match/matchType.js | 2 +- lib/match/rules.js | 2 +- package-lock.json | 502 ++++++++++++++++++++++++++++++++ package.json | 4 +- test/arrayType.test.js | 2 +- test/basicType.test.js | 2 +- test/customMessages.test.js | 4 +- test/defineType.test.js | 2 +- test/miscellaneousRules.test.js | 2 +- test/nestedRules.test.js | 2 +- test/objectType.test.js | 2 +- test/util/testRules.js | 2 +- test/util/testType.js | 2 +- 16 files changed, 523 insertions(+), 21 deletions(-) create mode 100644 package-lock.json diff --git a/index.js b/index.js index e677dc5..e6a7720 100644 --- a/index.js +++ b/index.js @@ -2,9 +2,9 @@ * Module dependencies */ -var util = require('@sailshq/lodash'); +var util = require('lodash'); var sanitize = require('validator').sanitize; -var _ = require('@sailshq/lodash'); +var _ = require('lodash'); diff --git a/lib/match/errorFactory.js b/lib/match/errorFactory.js index aca7486..35ce009 100644 --- a/lib/match/errorFactory.js +++ b/lib/match/errorFactory.js @@ -2,7 +2,7 @@ * Module dependencies */ -var _ = require('@sailshq/lodash'); +var _ = require('lodash'); var util = require('util'); @@ -48,7 +48,7 @@ module.exports = function errorFactory(value, ruleName, keyName, customMessage) // Default to just saying 'Value' if we don't have the property name of the value. keyName ? ('`' + keyName + '`') : 'Value', // Adjust the article ("a" or "an") based on whether the next word starts with a vowel. - _.contains(['a','e','i','o','u'], ruleName[0]) ? 'n' : '', + _.includes(['a','e','i','o','u'], ruleName[0]) ? 'n' : '', // Output the name of the expected data type (e.g. "string" or "boolean"). ruleName ); @@ -75,13 +75,13 @@ module.exports = function errorFactory(value, ruleName, keyName, customMessage) // Default to just saying 'Value' if we don't have the property name of the value. keyName ? ('`' + keyName + '`') : 'Value', // Adjust the article ("a" or "an") based on whether the next word starts with a vowel. - _.contains(['a','e','i','o','u'], ruleName[0]) ? 'n' : '', + _.includes(['a','e','i','o','u'], ruleName[0]) ? 'n' : '', // Output the name of the expected data type (e.g. "string" or "boolean"). ruleName, // Output the actual value that was passed in here. stringifiedValue, // Adjust the article ("a" or "an") based on whether the next word starts with a vowel. - _.contains(['a','e','i','o','u'], actualType[0]) ? 'n' : '', + _.includes(['a','e','i','o','u'], actualType[0]) ? 'n' : '', // Output the type of the value that was passed in. actualType ); diff --git a/lib/match/matchRule.js b/lib/match/matchRule.js index 8aabde1..697507e 100644 --- a/lib/match/matchRule.js +++ b/lib/match/matchRule.js @@ -3,7 +3,7 @@ */ var util = require('util'); -var _ = require('@sailshq/lodash'); +var _ = require('lodash'); var rules = require('./rules'); diff --git a/lib/match/matchType.js b/lib/match/matchType.js index f508718..04c75a4 100644 --- a/lib/match/matchType.js +++ b/lib/match/matchType.js @@ -3,7 +3,7 @@ */ var util = require('util'); -var _ = require('@sailshq/lodash'); +var _ = require('lodash'); var rules = require('./rules'); var errorFactory = require('./errorFactory'); diff --git a/lib/match/rules.js b/lib/match/rules.js index 16455e9..ba9210d 100644 --- a/lib/match/rules.js +++ b/lib/match/rules.js @@ -2,7 +2,7 @@ * Module dependencies */ -var _ = require('@sailshq/lodash'); +var _ = require('lodash'); var validator = require('validator'); var geojsonhint = require('@mapbox/geojsonhint'); diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..5013d31 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,502 @@ +{ + "name": "anchor", + "version": "0.11.6", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@mapbox/geojsonhint": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@mapbox/geojsonhint/-/geojsonhint-2.0.1.tgz", + "integrity": "sha1-MtrHMA8Es+uux0tbqYU9+0JTI1Q=", + "requires": { + "concat-stream": "~1.5.1", + "jsonlint-lines": "1.7.1", + "minimist": "1.2.0", + "vfile": "2.0.0", + "vfile-reporter": "3.0.0" + } + }, + "JSV": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/JSV/-/JSV-4.0.2.tgz", + "integrity": "sha1-0Hf2glVx+CEy+d/67Vh7QCn+/1c=" + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + }, + "ansi-styles": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-1.0.0.tgz", + "integrity": "sha1-yxAt8cVvUSPquLZ817mAJ6AnkXg=" + }, + "async": { + "version": "0.2.10", + "resolved": "https://registry.npmjs.org/async/-/async-0.2.10.tgz", + "integrity": "sha1-trvgsGdLnXGXCMo43owjfLUmw9E=", + "dev": true + }, + "chalk": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-0.4.0.tgz", + "integrity": "sha1-UZmj3c0MHv4jvAjBsCewYXbgxk8=", + "requires": { + "ansi-styles": "~1.0.0", + "has-color": "~0.1.0", + "strip-ansi": "~0.1.0" + } + }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" + }, + "commander": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.3.0.tgz", + "integrity": "sha1-/UMOiJgy7DU7ms0d4hfBHLPu+HM=", + "dev": true + }, + "concat-stream": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.5.2.tgz", + "integrity": "sha1-cIl4Yk2FavQaWnQd790mHadSwmY=", + "requires": { + "inherits": "~2.0.1", + "readable-stream": "~2.0.0", + "typedarray": "~0.0.5" + } + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + }, + "debug": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", + "integrity": "sha1-+HBX6ZWxofauaklgZkE3vFbwOdo=", + "dev": true, + "requires": { + "ms": "0.7.1" + } + }, + "diff": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-1.4.0.tgz", + "integrity": "sha1-fyjS657nsVqX79ic5j3P2qPMur8=", + "dev": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + }, + "glob": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-3.2.3.tgz", + "integrity": "sha1-4xPusknHr/qlxHUoaw4RW1mDlGc=", + "dev": true, + "requires": { + "graceful-fs": "~2.0.0", + "inherits": "2", + "minimatch": "~0.2.11" + } + }, + "graceful-fs": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-2.0.3.tgz", + "integrity": "sha1-fNLNsiiko/Nule+mzBQt59GhNtA=", + "dev": true + }, + "growl": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.8.1.tgz", + "integrity": "sha1-Sy3sjZB+k9szZiTc7AGDUC+MlCg=", + "dev": true + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "has-color": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/has-color/-/has-color-0.1.7.tgz", + "integrity": "sha1-ZxRKUmDDT8PMpnfQQdr1L+e3iy8=" + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "irregular-plurals": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/irregular-plurals/-/irregular-plurals-1.4.0.tgz", + "integrity": "sha1-LKmwM2UREYVUEvFr5dd8YqRYp2Y=" + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "jade": { + "version": "0.26.3", + "resolved": "https://registry.npmjs.org/jade/-/jade-0.26.3.tgz", + "integrity": "sha1-jxDXl32NefL2/4YqgbBRPMslaGw=", + "dev": true, + "requires": { + "commander": "0.6.1", + "mkdirp": "0.3.0" + }, + "dependencies": { + "commander": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-0.6.1.tgz", + "integrity": "sha1-+mihT2qUXVTbvlDYzbMyDp47GgY=", + "dev": true + }, + "mkdirp": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.0.tgz", + "integrity": "sha1-G79asbqCevI1dRQ0kEJkVfSB/h4=", + "dev": true + } + } + }, + "jsonlint-lines": { + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/jsonlint-lines/-/jsonlint-lines-1.7.1.tgz", + "integrity": "sha1-UH3mgNP7jEvhZBzFfW9nnynxeP8=", + "requires": { + "JSV": ">= 4.0.x", + "nomnom": ">= 1.5.x" + } + }, + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" + }, + "log-symbols": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-1.0.2.tgz", + "integrity": "sha1-N2/3tY6jCGoPCfrMdGF+ylAeGhg=", + "requires": { + "chalk": "^1.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=" + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "requires": { + "ansi-regex": "^2.0.0" + } + } + } + }, + "lru-cache": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz", + "integrity": "sha1-bUUk6LlV+V1PW1iFHOId1y+06VI=", + "dev": true + }, + "minimatch": { + "version": "0.2.14", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz", + "integrity": "sha1-x054BXT2PG+aCQ6Q775u9TpqdWo=", + "dev": true, + "requires": { + "lru-cache": "2", + "sigmund": "~1.0.0" + } + }, + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" + }, + "mkdirp": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.0.tgz", + "integrity": "sha1-HXMHam35hs2TROFecfzAWkyavxI=", + "dev": true, + "requires": { + "minimist": "0.0.8" + }, + "dependencies": { + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + } + } + }, + "mocha": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-2.3.4.tgz", + "integrity": "sha1-himm+wRPLSJapLgaKuLQAWmesmY=", + "dev": true, + "requires": { + "commander": "2.3.0", + "debug": "2.2.0", + "diff": "1.4.0", + "escape-string-regexp": "1.0.2", + "glob": "3.2.3", + "growl": "1.8.1", + "jade": "0.26.3", + "mkdirp": "0.5.0", + "supports-color": "1.2.0" + }, + "dependencies": { + "escape-string-regexp": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.2.tgz", + "integrity": "sha1-Tbwv5nTnGUnK8/smlc5/LcHZqNE=", + "dev": true + }, + "supports-color": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-1.2.0.tgz", + "integrity": "sha1-/x7R5hFp0Gs88tWI4YixjYhH4X4=", + "dev": true + } + } + }, + "ms": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", + "integrity": "sha1-nNE8A62/8ltl7/3nzoZO6VIBcJg=", + "dev": true + }, + "nomnom": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/nomnom/-/nomnom-1.8.1.tgz", + "integrity": "sha1-IVH3Ikcrp55Qp2/BJbuMjy5Nwqc=", + "requires": { + "chalk": "~0.4.0", + "underscore": "~1.6.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" + }, + "plur": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/plur/-/plur-2.1.2.tgz", + "integrity": "sha1-dIJFLBoPUI4+NE6uwxLJHCncZVo=", + "requires": { + "irregular-plurals": "^1.0.0" + } + }, + "process-nextick-args": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", + "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=" + }, + "readable-stream": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz", + "integrity": "sha1-j5A0HmilPMySh4jaz80Rs265t44=", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "~1.0.0", + "process-nextick-args": "~1.0.6", + "string_decoder": "~0.10.x", + "util-deprecate": "~1.0.1" + } + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=" + }, + "replace-ext": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.0.tgz", + "integrity": "sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs=" + }, + "sigmund": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz", + "integrity": "sha1-P/IfGYytIXX587eBhT/ZTQ0ZtZA=", + "dev": true + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + }, + "dependencies": { + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "requires": { + "ansi-regex": "^2.0.0" + } + } + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + }, + "strip-ansi": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.1.1.tgz", + "integrity": "sha1-OeipjQRNFQZgq+SmgIrPcLt7yZE=" + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=" + }, + "trim": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/trim/-/trim-0.0.1.tgz", + "integrity": "sha1-WFhUf2spB1fulczMZm+1AITEYN0=" + }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=" + }, + "underscore": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.6.0.tgz", + "integrity": "sha1-izixDKze9jM3uLJOT/htRa6lKag=" + }, + "unist-util-stringify-position": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-1.1.2.tgz", + "integrity": "sha512-pNCVrk64LZv1kElr0N1wPiHEUoXNVFERp+mlTg/s9R5Lwg87f9bM/3sQB99w+N9D/qnM9ar3+AKDBwo/gm/iQQ==" + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + }, + "validator": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/validator/-/validator-4.4.0.tgz", + "integrity": "sha1-NeKVVd1feCb5cKTq7P+ebfbfPaY=" + }, + "vfile": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-2.0.0.tgz", + "integrity": "sha1-iGIFAONrrQJaCwHMJRBtvLMJBUg=", + "requires": { + "has": "^1.0.1", + "is-buffer": "^1.1.4", + "replace-ext": "1.0.0", + "unist-util-stringify-position": "^1.0.0", + "x-is-string": "^0.1.0" + } + }, + "vfile-reporter": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/vfile-reporter/-/vfile-reporter-3.0.0.tgz", + "integrity": "sha1-/lBxTjc+DSlAUQA4qZvWCb3IIJ8=", + "requires": { + "chalk": "^1.1.0", + "log-symbols": "^1.0.2", + "plur": "^2.0.0", + "repeat-string": "^1.5.0", + "string-width": "^1.0.0", + "strip-ansi": "^3.0.1", + "trim": "0.0.1", + "unist-util-stringify-position": "^1.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=" + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "requires": { + "ansi-regex": "^2.0.0" + } + } + } + }, + "x-is-string": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/x-is-string/-/x-is-string-0.1.0.tgz", + "integrity": "sha1-R0tQhlrzpJqcRlfwWs0UVFj3fYI=" + } + } +} diff --git a/package.json b/package.json index 3510797..a82ea8e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "anchor", - "version": "0.11.6", + "version": "0.12.0", "description": "Recursive validation library with support for objects and lists", "homepage": "http://sailsjs.org", "keywords": [ @@ -32,7 +32,7 @@ "readmeFilename": "README.md", "dependencies": { "@mapbox/geojsonhint": "2.0.1", - "@sailshq/lodash": "^3.10.2", + "lodash": "^4.17.15", "validator": "4.4.0" }, "devDependencies": { diff --git a/test/arrayType.test.js b/test/arrayType.test.js index b64f331..94f6b84 100644 --- a/test/arrayType.test.js +++ b/test/arrayType.test.js @@ -1,4 +1,4 @@ -var _ = require('@sailshq/lodash'); +var _ = require('lodash'); var anchor = require('../index.js'); var testType = require('./util/testType.js'); diff --git a/test/basicType.test.js b/test/basicType.test.js index aa9e90f..1ffb5fc 100644 --- a/test/basicType.test.js +++ b/test/basicType.test.js @@ -1,4 +1,4 @@ -var _ = require('@sailshq/lodash'); +var _ = require('lodash'); var anchor = require('../index.js'); var testType = require('./util/testType.js'); diff --git a/test/customMessages.test.js b/test/customMessages.test.js index dddd7ef..74831b2 100644 --- a/test/customMessages.test.js +++ b/test/customMessages.test.js @@ -1,4 +1,4 @@ -var _ = require('@sailshq/lodash'); +var _ = require('lodash'); var anchor = require('../index.js'); var testType = require('./util/testType.js'); var assert = require('assert'); @@ -49,7 +49,7 @@ describe('custom validation messages ($message syntax)', function() { } }); - var ok = _.all(errors, function (err) { + var ok = _.every(errors, function (err) { switch(err.property) { case 'name': return err.message === 'oops0'; case 'id': return err.message === 'oops1'; diff --git a/test/defineType.test.js b/test/defineType.test.js index aedea89..dffec57 100644 --- a/test/defineType.test.js +++ b/test/defineType.test.js @@ -1,4 +1,4 @@ -var _ = require('@sailshq/lodash'); +var _ = require('lodash'); var anchor = require('../index.js'); var async = require('async'); var assert = require("assert"); diff --git a/test/miscellaneousRules.test.js b/test/miscellaneousRules.test.js index bd5fb8e..2383ea8 100644 --- a/test/miscellaneousRules.test.js +++ b/test/miscellaneousRules.test.js @@ -1,4 +1,4 @@ -var _ = require('@sailshq/lodash'); +var _ = require('lodash'); var anchor = require('../index.js'); var testRules = require('./util/testRules.js'); diff --git a/test/nestedRules.test.js b/test/nestedRules.test.js index 34acdba..08b9e3c 100644 --- a/test/nestedRules.test.js +++ b/test/nestedRules.test.js @@ -1,4 +1,4 @@ -var _ = require('@sailshq/lodash'); +var _ = require('lodash'); var anchor = require('../index.js'); var testType = require('./util/testType.js'); diff --git a/test/objectType.test.js b/test/objectType.test.js index f3e8b56..732d0b9 100644 --- a/test/objectType.test.js +++ b/test/objectType.test.js @@ -1,4 +1,4 @@ -var _ = require('@sailshq/lodash'); +var _ = require('lodash'); var anchor = require('../index.js'); var testType = require('./util/testType.js'); diff --git a/test/util/testRules.js b/test/util/testRules.js index f5ab7f2..c3d96b8 100644 --- a/test/util/testRules.js +++ b/test/util/testRules.js @@ -1,4 +1,4 @@ -var _ = require('@sailshq/lodash'); +var _ = require('lodash'); var anchor = require('../../index.js'); var async = require('async'); diff --git a/test/util/testType.js b/test/util/testType.js index e7d4662..932bd3a 100644 --- a/test/util/testType.js +++ b/test/util/testType.js @@ -1,4 +1,4 @@ -var _ = require('@sailshq/lodash'); +var _ = require('lodash'); var anchor = require('../../index.js'); var async = require('async');