Skip to content

Commit

Permalink
Move away from @hapi/joi (#190)
Browse files Browse the repository at this point in the history
Closes #187
  • Loading branch information
arb authored Sep 4, 2020
1 parent a2bfb37 commit 0a02df1
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/celebrate.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const HTTP = require('http');
const Joi = require('@hapi/joi');
const Joi = require('joi');
const _ = require('lodash');
const EscapeHtml = require('escape-html');
const {
Expand Down
2 changes: 1 addition & 1 deletion lib/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
Root as joi,
ValidationOptions,
ValidationError,
} from '@hapi/joi';
} from 'joi';


export declare enum Segments {
Expand Down
2 changes: 1 addition & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const Joi = require('@hapi/joi');
const {
celebrate,
celebrator,
errors,
Joi,
} = require('./celebrate');

const {
Expand Down
2 changes: 1 addition & 1 deletion lib/schema.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const HTTP = require('http');
const Joi = require('@hapi/joi');
const Joi = require('joi');
const {
segments,
modes,
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
},
"homepage": "https://github.com/arb/celebrate#readme",
"dependencies": {
"@hapi/joi": "17.x.x",
"@types/hapi__joi": "17.x.x",
"joi": "17.x.x",
"escape-html": "1.0.3",
"lodash": "4.17.x"
},
Expand Down
6 changes: 3 additions & 3 deletions test/__snapshots__/celebrate.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Object {
"keys": Array [
"role",
],
"message": "\\"role\\" must be larger than or equal to 4",
"message": "\\"role\\" must be greater than or equal to 4",
"source": "query",
},
},
Expand All @@ -36,7 +36,7 @@ Object {
"role",
"name",
],
"message": "\\"role\\" must be larger than or equal to 4. \\"name\\" is required",
"message": "\\"role\\" must be greater than or equal to 4. \\"name\\" is required",
"source": "query",
},
},
Expand All @@ -53,7 +53,7 @@ Object {
"keys": Array [
"role",
],
"message": "\\"role\\" must be larger than or equal to 4",
"message": "\\"role\\" must be greater than or equal to 4",
"source": "query",
},
},
Expand Down

0 comments on commit 0a02df1

Please sign in to comment.