Skip to content

Commit

Permalink
BREAKING CHANGE: update to support @hapi/joi v16 (#23)
Browse files Browse the repository at this point in the history
* BREAKING CHANGE: update to support @hapi/joi v16

* chore: pin to minor versions in deps

* fix: bump node types

* chore: update licence
  • Loading branch information
evanshortiss authored Sep 20, 2019
1 parent 6a721bf commit 5ffdb02
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 21 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ language: node_js

node_js:
- "12"
- "11"
- "10"
- "8"

Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
## CHANGELOG
Date format is DD/MM/YYYY

## 4.0.0 (20/09/2019)
* Update to support Joi v16.x
* No longer supports passing a Joi instance to factory
* Finally removed deprecated function on `module.exports` from v2

## 3.0.0 (30/08/2019)
* Removed `fields`, `originalQuery`, `originalHeaders`, `originalBody`,
`originalParams`, and `originalFields` from `ValidatedRequest`. This simplifies
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(The MIT License)

Copyright (c) 2017 Evan Shortiss <evanshortiss@gmail.com>
Copyright (c) 2017-2019 Evan Shortiss <evanshortiss@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down
6 changes: 0 additions & 6 deletions express-joi-validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,6 @@ function buildErrorString(err, container) {
return ret
}

module.exports = function() {
throw new Error(
'express-joi-validation: exported member is no longer a factory function. use exported createValidator function instead'
)
}

module.exports.createValidator = function generateJoiMiddlewareInstance(cfg) {
cfg = cfg || {} // default to an empty config
// We'll return this instance of the middleware
Expand Down
19 changes: 6 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "express-joi-validation",
"version": "3.0.0",
"version": "4.0.0",
"description": "validate express application inputs and parameters using joi",
"main": "express-joi-validation.js",
"scripts": {
Expand All @@ -22,25 +22,18 @@
"joi",
"express",
"validation",
"validator",
"middleware",
"validate",
"sanatize",
"sanatise",
"input",
"parameter",
"typescript",
"ts",
"tsc"
],
"author": "Evan Shortiss",
"license": "MIT",
"devDependencies": {
"@hapi/joi": "~15.0.3",
"@hapi/joi": "~16.1.2",
"@types/express": "~4.0.39",
"@types/express-formidable": "~1.0.4",
"@types/hapi__joi": "~15.0.2",
"@types/node": "^6.0.117",
"@types/node": "~10.14.18",
"body-parser": "~1.18.3",
"chai": "~3.5.0",
"clear-require": "~2.0.0",
Expand All @@ -50,10 +43,10 @@
"husky": "~1.0.1",
"joi-extract-type": "~15.0.0",
"lint-staged": "~8.2.1",
"lodash": "~4.17.4",
"lodash": "~4.17.15",
"mocha": "~5.2.0",
"mocha-lcov-reporter": "~1.3.0",
"nodemon": "~1.11.0",
"nodemon": "~1.19.2",
"nyc": "~14.1.1",
"prettier": "~1.14.3",
"proxyquire": "~1.7.11",
Expand All @@ -62,7 +55,7 @@
"typescript": "~3.5.2"
},
"peerDependencies": {
"@hapi/joi": "*"
"@hapi/joi": "16"
},
"engines": {
"node": ">=8.0.0"
Expand Down

0 comments on commit 5ffdb02

Please sign in to comment.