Skip to content

Commit

Permalink
fix code and test ⛳️ .. (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
3imed-jaberi committed Jul 7, 2020
1 parent 0d9bd21 commit 7f9901f
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 55 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ You can also specify a base URI in the environment variable for rendering as `pr

## License

[MIT](LICENSE) © Nick Baugh
[MIT](LICENSE) © [Nick Baugh](http://niftylettuce.com/)


##
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ function parseValidationError(ctx, err) {
: message;

// passport-local-mongoose support
if (passportLocalMongooseErrorNames.has(err.name)) {
if (passportLocalMongooseErrorNames.includes(err.name)) {
err.message = translate(err.message);
// this ensures the error shows up client-side
err.status = 400;
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"@commitlint/cli": "^9.0.1",
"@commitlint/config-conventional": "^9.0.1",
"@koa/router": "^9.3.1",
"ava": "^3.10.0",
"ava": "3.8.2",
"codecov": "^3.7.0",
"cross-env": "^7.0.2",
"eslint-config-xo-lass": "^1.0.3",
Expand Down Expand Up @@ -163,7 +163,8 @@
"rules": {
"no-negated-condition": "off",
"unicorn/prevent-abbreviations": "off",
"unicorn/prefer-number-properties": "off"
"unicorn/prefer-number-properties": "off",
"unicorn/prefer-set-has": "off"
}
}
}
132 changes: 81 additions & 51 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -571,12 +571,12 @@ acorn-jsx@^5.2.0:
resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.2.0.tgz#4c66069173d6fdd68ed85239fc256226182b2ebe"
integrity sha512-HiUX/+K2YpkpJ+SzBffkM/AQ2YE03S0U1kjTLVpoJdhZMOWy8qvXVN9JdLqv2QsaQ6MPYQIuNmwD8zOiYUofLQ==

acorn-walk@^7.2.0:
acorn-walk@^7.1.1:
version "7.2.0"
resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-7.2.0.tgz#0de889a601203909b0fbe07b8938dc21d2e967bc"
integrity sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==

acorn@^7.2.0, acorn@^7.3.1:
acorn@^7.1.1, acorn@^7.2.0:
version "7.3.1"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.3.1.tgz#85010754db53c3fbaf3b9ea3e083aa5c5d147ffd"
integrity sha512-tLc0wSnatxAQHVHUapaHdz72pi9KUyHjq5KyHjGg9Y8Ifdc79pTh2XvI6I1/chZbnM7QtNKzh66ooDogPZSleA==
Expand Down Expand Up @@ -846,42 +846,42 @@ author-regex@^1.0.0:
resolved "https://registry.yarnpkg.com/author-regex/-/author-regex-1.0.0.tgz#d08885be6b9bbf9439fe087c76287245f0a81450"
integrity sha1-0IiFvmubv5Q5/gh8dihyRfCoFFA=

ava@^3.10.0:
version "3.10.0"
resolved "https://registry.yarnpkg.com/ava/-/ava-3.10.0.tgz#ed1a53986435fc1cd8c15978cd8ff81217c34831"
integrity sha512-CxcYQYeE39pcLWrN2/TASMpnqH/SoaX+W61+4m3saETU041PIDcoP9LLNWPAE/yJZXjp0M1RWTohSkmGqJZKww==
ava@3.8.2:
version "3.8.2"
resolved "https://registry.yarnpkg.com/ava/-/ava-3.8.2.tgz#877c9eb861763a185bbabd54f359e1fbe57d1754"
integrity sha512-sph3oUsVTGsq4qbgeWys03QKCmXjkZUO3oPnFWXEW6g1SReCY9vuONGghMgw1G6VOzkg1k+niqJsOzwfO8h9Ng==
dependencies:
"@concordance/react" "^2.0.0"
acorn "^7.3.1"
acorn-walk "^7.2.0"
acorn "^7.1.1"
acorn-walk "^7.1.1"
ansi-styles "^4.2.1"
arrgv "^1.0.2"
arrify "^2.0.1"
callsites "^3.1.0"
chalk "^4.1.0"
chalk "^4.0.0"
chokidar "^3.4.0"
chunkd "^2.0.1"
ci-info "^2.0.0"
ci-parallel-vars "^1.0.1"
ci-parallel-vars "^1.0.0"
clean-yaml-object "^0.1.0"
cli-cursor "^3.1.0"
cli-truncate "^2.1.0"
code-excerpt "^3.0.0"
code-excerpt "^2.1.1"
common-path-prefix "^3.0.0"
concordance "^5.0.0"
concordance "^4.0.0"
convert-source-map "^1.7.0"
currently-unhandled "^0.4.1"
debug "^4.1.1"
del "^5.1.0"
emittery "^0.7.0"
emittery "^0.6.0"
equal-length "^1.0.0"
figures "^3.2.0"
globby "^11.0.1"
ignore-by-default "^2.0.0"
globby "^11.0.0"
ignore-by-default "^1.0.0"
import-local "^3.0.2"
indent-string "^4.0.0"
is-error "^2.2.2"
is-plain-object "^3.0.1"
is-plain-object "^3.0.0"
is-promise "^4.0.0"
lodash "^4.17.15"
matcher "^3.0.0"
Expand All @@ -905,7 +905,7 @@ ava@^3.10.0:
trim-off-newlines "^1.0.1"
update-notifier "^4.1.0"
write-file-atomic "^3.0.3"
yargs "^15.4.0"
yargs "^15.3.1"

babel-eslint@^10.1.0:
version "10.1.0"
Expand Down Expand Up @@ -1230,7 +1230,7 @@ chalk@^2.0.0, chalk@^2.4.1, chalk@^2.4.2:
escape-string-regexp "^1.0.5"
supports-color "^5.3.0"

chalk@^4.0.0, chalk@^4.1.0:
chalk@^4.0.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.0.tgz#4e14870a618d9e2edd97dd8345fd9d9dc315646a"
integrity sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==
Expand Down Expand Up @@ -1283,7 +1283,7 @@ ci-info@^2.0.0:
resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46"
integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==

ci-parallel-vars@^1.0.1:
ci-parallel-vars@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/ci-parallel-vars/-/ci-parallel-vars-1.0.1.tgz#e87ff0625ccf9d286985b29b4ada8485ca9ffbc2"
integrity sha512-uvzpYrpmidaoxvIQHM+rKSrigjOe9feHYbw4uOI2gdfe1C3xIlxO+kVXq83WQWNniTf8bAxVpy+cQeFQsMERKg==
Expand Down Expand Up @@ -1391,10 +1391,10 @@ co@^4.0.0, co@^4.6.0:
resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184"
integrity sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=

code-excerpt@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/code-excerpt/-/code-excerpt-3.0.0.tgz#fcfb6748c03dba8431c19f5474747fad3f250f10"
integrity sha512-VHNTVhd7KsLGOqfX3SyeO8RyYPMp1GJOg194VITk04WMYCv4plV68YWe6TJZxd9MhobjtpMRnVky01gqZsalaw==
code-excerpt@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/code-excerpt/-/code-excerpt-2.1.1.tgz#5fe3057bfbb71a5f300f659ef2cc0a47651ba77c"
integrity sha512-tJLhH3EpFm/1x7heIW0hemXJTUU5EWl2V0EIX558jp05Mt1U6DVryCgkp3l37cxqs+DNbNgxG43SkwJXpQ14Jw==
dependencies:
convert-to-spaces "^1.0.1"

Expand Down Expand Up @@ -1501,18 +1501,21 @@ concat-stream@^2.0.0:
readable-stream "^3.0.2"
typedarray "^0.0.6"

concordance@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/concordance/-/concordance-5.0.0.tgz#6d4552f76c78301dd65e748c26af2cf131f9dd49"
integrity sha512-stOCz9ffg0+rytwTaL2njUOIyMfANwfwmqc9Dr4vTUS/x/KkVFlWx9Zlzu6tHYtjKxxaCF/cEAZgPDac+n35sg==
concordance@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/concordance/-/concordance-4.0.0.tgz#5932fdee397d129bdbc3a1885fbe69839b1b7e15"
integrity sha512-l0RFuB8RLfCS0Pt2Id39/oCPykE01pyxgAFypWTlaGRgvLkZrtczZ8atEHpTeEIW+zYWXTBuA9cCSeEOScxReQ==
dependencies:
date-time "^3.1.0"
esutils "^2.0.3"
fast-diff "^1.2.0"
date-time "^2.1.0"
esutils "^2.0.2"
fast-diff "^1.1.2"
js-string-escape "^1.0.1"
lodash "^4.17.15"
md5-hex "^3.0.1"
semver "^7.3.2"
lodash.clonedeep "^4.5.0"
lodash.flattendeep "^4.4.0"
lodash.islength "^4.0.1"
lodash.merge "^4.6.1"
md5-hex "^2.0.0"
semver "^5.5.1"
well-known-symbols "^2.0.0"

configstore@^5.0.1:
Expand Down Expand Up @@ -1744,10 +1747,10 @@ dargs@^7.0.0:
resolved "https://registry.yarnpkg.com/dargs/-/dargs-7.0.0.tgz#04015c41de0bcb69ec84050f3d9be0caf8d6d5cc"
integrity sha512-2iy1EkLdlBzQGvbweYRFxmFath8+K7+AKB0TlhHWkNuH+TmovaMH/Wp7V7R4u7f4SnX3OgLsU9t1NI9ioDnUpg==

date-time@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/date-time/-/date-time-3.1.0.tgz#0d1e934d170579f481ed8df1e2b8ff70ee845e1e"
integrity sha512-uqCUKXE5q1PNBXjPqvwhwJf9SwMoAHBgWJ6DcrnS5o+W2JOiIILl0JEdVD8SGujrNS02GGxgwAg2PN2zONgtjg==
date-time@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/date-time/-/date-time-2.1.0.tgz#0286d1b4c769633b3ca13e1e62558d2dbdc2eba2"
integrity sha512-/9+C44X7lot0IeiyfgJmETtRMhBidBYM2QFFIkGa0U1k+hSyY87Nw7PY3eDqpvCBm7I3WCSfPeZskW/YYq6m4g==
dependencies:
time-zone "^1.0.0"

Expand Down Expand Up @@ -2058,10 +2061,10 @@ elliptic@^6.0.0, elliptic@^6.5.2:
minimalistic-assert "^1.0.0"
minimalistic-crypto-utils "^1.0.0"

emittery@^0.7.0:
version "0.7.1"
resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.7.1.tgz#c02375a927a40948c0345cc903072597f5270451"
integrity sha512-d34LN4L6h18Bzz9xpoku2nPwKxCPlPMr3EEKTkoEBi+1/+b0lcRkRJ1UVyyZaKNeqGR3swcGl6s390DNO4YVgQ==
emittery@^0.6.0:
version "0.6.0"
resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.6.0.tgz#e85312468d77c3ed9a6adf43bb57d34849e0c95a"
integrity sha512-6EMRGr9KzYWp8DzHFZsKVZBsMO6QhAeHMeHND8rhyBNCHKMLpgW9tZv40bwN3rAIKRS5CxcK8oLRKUJSB9h7yQ==

"emoji-regex@>=6.0.0 <=6.1.1":
version "6.1.1"
Expand Down Expand Up @@ -2505,7 +2508,7 @@ estraverse@~1.3.0:
resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-1.3.2.tgz#37c2b893ef13d723f276d878d60d8535152a6c42"
integrity sha1-N8K4k+8T1yPydth41g2FNRUqbEI=

esutils@^2.0.2, esutils@^2.0.3:
esutils@^2.0.2:
version "2.0.3"
resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64"
integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==
Expand Down Expand Up @@ -2595,7 +2598,7 @@ fast-deep-equal@^3.1.1:
resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525"
integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==

fast-diff@^1.1.2, fast-diff@^1.2.0:
fast-diff@^1.1.2:
version "1.2.0"
resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03"
integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==
Expand Down Expand Up @@ -2988,7 +2991,7 @@ globby@^10.0.1:
merge2 "^1.2.3"
slash "^3.0.0"

globby@^11.0.1:
globby@^11.0.0:
version "11.0.1"
resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.1.tgz#9a2bf107a068f3ffeabc49ad702c79ede8cfd357"
integrity sha512-iH9RmgwCmUJHi2z5o2l3eTtGBtXek1OYlHrbcxOYugyHLmAsZrPj43OtHThd62Buh/Vv6VyCBD2bdyWcGNQqoQ==
Expand Down Expand Up @@ -3267,10 +3270,10 @@ ieee754@^1.1.4:
resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.13.tgz#ec168558e95aa181fd87d37f55c32bbcb6708b84"
integrity sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==

ignore-by-default@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/ignore-by-default/-/ignore-by-default-2.0.0.tgz#537092018540640459569fe7c8c7a408af581146"
integrity sha512-+mQSgMRiFD3L3AOxLYOCxjIq4OnAmo5CIuC+lj5ehCJcPtV++QacEV7FdpzvYxH6DaOySWzQU6RR0lPLy37ckA==
ignore-by-default@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/ignore-by-default/-/ignore-by-default-1.0.1.tgz#48ca6d72f6c6a3af00a9ad4ae6876be3889e2b09"
integrity sha1-SMptcvbGo68Aqa1K5odr44ieKwk=

ignore-walk@3.0.3:
version "3.0.3"
Expand Down Expand Up @@ -3660,7 +3663,7 @@ is-plain-object@^2.0.3, is-plain-object@^2.0.4:
dependencies:
isobject "^3.0.1"

is-plain-object@^3.0.1:
is-plain-object@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-3.0.1.tgz#662d92d24c0aa4302407b0d45d21f2251c85f85b"
integrity sha512-Xnpx182SBMrr/aBik8y+GuR4U1L9FqMSojwDQwPMmxyC6bvEqly9UBCxhauBF5vNh2gwWJNX6oDV7O+OM4z34g==
Expand Down Expand Up @@ -4206,6 +4209,11 @@ lodash._reinterpolate@^3.0.0:
resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d"
integrity sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0=

lodash.clonedeep@^4.5.0:
version "4.5.0"
resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef"
integrity sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=

lodash.defaults@^4.2.0:
version "4.2.0"
resolved "https://registry.yarnpkg.com/lodash.defaults/-/lodash.defaults-4.2.0.tgz#d09178716ffea4dde9e5fb7b37f6f0802274580c"
Expand Down Expand Up @@ -4236,6 +4244,11 @@ lodash.isfunction@^3.0.9:
resolved "https://registry.yarnpkg.com/lodash.isfunction/-/lodash.isfunction-3.0.9.tgz#06de25df4db327ac931981d1bdb067e5af68d051"
integrity sha512-AirXNj15uRIMMPihnkInB4i3NHeb4iBtNg9WRWuK2o31S+ePwwNmDPaTL3o7dTJ+VXNZim7rFs4rxN4YU1oUJw==

lodash.islength@^4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/lodash.islength/-/lodash.islength-4.0.1.tgz#4e9868d452575d750affd358c979543dc20ed577"
integrity sha1-Tpho1FJXXXUK/9NYyXlUPcIO1Xc=

lodash.isnumber@^3.0.3:
version "3.0.3"
resolved "https://registry.yarnpkg.com/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz#3ce76810c5928d03352301ac287317f11c0b1ffc"
Expand All @@ -4256,6 +4269,11 @@ lodash.map@^4.6.0:
resolved "https://registry.yarnpkg.com/lodash.map/-/lodash.map-4.6.0.tgz#771ec7839e3473d9c4cde28b19394c3562f4f6d3"
integrity sha1-dx7Hg540c9nEzeKLGTlMNWL09tM=

lodash.merge@^4.6.1:
version "4.6.2"
resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a"
integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==

lodash.template@^4.0.2:
version "4.5.0"
resolved "https://registry.yarnpkg.com/lodash.template/-/lodash.template-4.5.0.tgz#f976195cf3f347d0d5f52483569fe8031ccce8ab"
Expand Down Expand Up @@ -4410,13 +4428,25 @@ matcher@^3.0.0:
dependencies:
escape-string-regexp "^4.0.0"

md5-hex@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/md5-hex/-/md5-hex-2.0.0.tgz#d0588e9f1c74954492ecd24ac0ac6ce997d92e33"
integrity sha1-0FiOnxx0lUSS7NJKwKxs6ZfZLjM=
dependencies:
md5-o-matic "^0.1.1"

md5-hex@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/md5-hex/-/md5-hex-3.0.1.tgz#be3741b510591434b2784d79e556eefc2c9a8e5c"
integrity sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw==
dependencies:
blueimp-md5 "^2.10.0"

md5-o-matic@^0.1.1:
version "0.1.1"
resolved "https://registry.yarnpkg.com/md5-o-matic/-/md5-o-matic-0.1.1.tgz#822bccd65e117c514fab176b25945d54100a03c3"
integrity sha1-givM1l4RfFFPqxdrJZRdVBAKA8M=

md5.js@^1.3.4:
version "1.3.5"
resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f"
Expand Down Expand Up @@ -6648,7 +6678,7 @@ semver-regex@^2.0.0:
resolved "https://registry.yarnpkg.com/semver-regex/-/semver-regex-2.0.0.tgz#a93c2c5844539a770233379107b38c7b4ac9d338"
integrity sha512-mUdIBBvdn0PLOeP3TEkMH7HHeUP3GjsXCwKarjv/kGmUFOYg1VqEemKhoQpWMu6X2I8kHeuVdGibLGkVK+/5Qw==

"semver@2 || 3 || 4 || 5", semver@^5.4.1, semver@^5.7.1:
"semver@2 || 3 || 4 || 5", semver@^5.4.1, semver@^5.5.1, semver@^5.7.1:
version "5.7.1"
resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7"
integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==
Expand Down Expand Up @@ -7984,7 +8014,7 @@ yargs-parser@^18.1.2, yargs-parser@^18.1.3:
camelcase "^5.0.0"
decamelize "^1.2.0"

yargs@^15.0.2, yargs@^15.4.0:
yargs@^15.0.2, yargs@^15.3.1:
version "15.4.0"
resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.4.0.tgz#53949fb768309bac1843de9b17b80051e9805ec2"
integrity sha512-D3fRFnZwLWp8jVAAhPZBsmeIHY8tTsb8ItV9KaAaopmC6wde2u6Yw29JBIZHXw14kgkRnYmDgmQU4FVMDlIsWw==
Expand Down

0 comments on commit 7f9901f

Please sign in to comment.