Skip to content

Commit 976c9dd

Browse files
committed
feat: migrate to @hapi/joi, replace lodash with counterparts
1 parent 92e295e commit 976c9dd

File tree

11 files changed

+1167
-642
lines changed

11 files changed

+1167
-642
lines changed

.mdeprc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"node": "10.13.0"
2+
"node": "10.16.0"
33
}

package.json

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -36,34 +36,36 @@
3636
"node": ">= 8.9.0"
3737
},
3838
"devDependencies": {
39-
"@babel/cli": "^7.0.0",
40-
"@babel/core": "^7.0.0",
41-
"@babel/plugin-proposal-class-properties": "^7.0.0",
42-
"@babel/plugin-proposal-object-rest-spread": "^7.0.0",
43-
"@babel/plugin-transform-strict-mode": "^7.0.0",
44-
"@babel/register": "^7.0.0",
45-
"@makeomatic/deploy": "^8.2.3",
46-
"babel-eslint": "^10.0.1",
47-
"babel-plugin-istanbul": "^5.1.0",
48-
"codecov": "^3.1.0",
39+
"@babel/cli": "^7.4.4",
40+
"@babel/core": "^7.4.5",
41+
"@babel/plugin-proposal-class-properties": "^7.4.4",
42+
"@babel/plugin-proposal-object-rest-spread": "^7.4.4",
43+
"@babel/plugin-transform-strict-mode": "^7.2.0",
44+
"@babel/register": "^7.4.4",
45+
"@makeomatic/deploy": "^8.4.4",
46+
"babel-eslint": "^10.0.2",
47+
"babel-plugin-istanbul": "^5.1.4",
48+
"codecov": "^3.5.0",
4949
"cross-env": "^5.2.0",
50-
"eslint": "^5.9.0",
50+
"eslint": "^6.0.1",
5151
"eslint-config-makeomatic": "^3.0.0",
52-
"eslint-plugin-import": "^2.14.0",
53-
"eslint-plugin-mocha": "^5.2.0",
54-
"eslint-plugin-promise": "^4.0.1",
55-
"ioredis": "^4.2.0",
56-
"mocha": "^5.2.0",
57-
"nyc": "^13.1.0",
58-
"rimraf": "^2.6.2"
52+
"eslint-plugin-import": "^2.18.0",
53+
"eslint-plugin-mocha": "^5.3.0",
54+
"eslint-plugin-promise": "^4.2.1",
55+
"ioredis": "^4.10.0",
56+
"mocha": "^6.1.4",
57+
"nyc": "^14.1.1",
58+
"rimraf": "^2.6.3"
5959
},
6060
"dependencies": {
61-
"base64-url": "^2.2.0",
62-
"chance": "^1.0.16",
63-
"glob": "^7.1.3",
64-
"is": "^3.2.1",
65-
"joi": "^14.0.6",
66-
"lodash": "^4.17.11",
61+
"@hapi/joi": "^15.0.0",
62+
"base64-url": "^2.2.2",
63+
"chance": "^1.0.18",
64+
"get-value": "^3.0.1",
65+
"glob": "^7.1.4",
66+
"is": "^3.3.0",
67+
"lodash.compact": "^3.0.1",
68+
"lodash.omit": "^4.5.0",
6769
"uuid": "^3.3.2"
6870
},
6971
"files": [

src/actions/create.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const Joi = require('joi');
1+
const Joi = require('@hapi/joi');
22
const uuid = require('uuid');
33
const crypto = require('../utils/crypto');
44

src/actions/info.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const Joi = require('joi');
1+
const Joi = require('@hapi/joi');
22
const crypto = require('../utils/crypto');
33

44
// actual data schema

src/actions/regenerate.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const Joi = require('joi');
1+
const Joi = require('@hapi/joi');
22
const crypto = require('../utils/crypto');
33

44
// actual data schema

src/actions/remove.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const Joi = require('joi');
1+
const Joi = require('@hapi/joi');
22
const is = require('is');
33
const crypto = require('../utils/crypto');
44

src/actions/verify.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const Joi = require('joi');
1+
const Joi = require('@hapi/joi');
22
const is = require('is');
33
const assert = require('assert');
44
const crypto = require('../utils/crypto');

src/backends/redis/redis.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
const filter = require('lodash/filter');
2-
const get = require('lodash/get');
3-
const omit = require('lodash/omit');
4-
const compact = require('lodash/compact');
1+
const get = require('get-value');
2+
const omit = require('lodash.omit');
3+
const compact = require('lodash.compact');
54
const glob = require('glob');
65
const fs = require('fs');
76
const path = require('path');
@@ -53,7 +52,7 @@ class RedisBackend {
5352

5453
// redis key helpers
5554
key(...args) {
56-
return this.prefix + filter(args, Boolean).join('!');
55+
return this.prefix + args.filter(Boolean).join('!');
5756
}
5857

5958
uid(uid) {

src/defaults.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const Joi = require('joi');
1+
const Joi = require('@hapi/joi');
22
const glob = require('glob');
33
const path = require('path');
44
const pkg = require('../package.json');

test/docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ version: '3'
22

33
services:
44
redis:
5-
image: redis:4-alpine
5+
image: redis:5-alpine
66

77
tester:
8-
image: makeomatic/node:10.13.0-tester
8+
image: makeomatic/node:10.16.0-tester
99
depends_on:
1010
- redis
1111
working_dir: /src

0 commit comments

Comments
 (0)