Skip to content

Commit cd6fe3e

Browse files
authored
Support node v18 and drop node v12 (#82)
* Support node v18, drop node v12 * Update to validate v2
1 parent 7aa9504 commit cd6fe3e

File tree

4 files changed

+15
-12
lines changed

4 files changed

+15
-12
lines changed

.github/workflows/ci-module.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@ name: ci
33
on:
44
push:
55
branches:
6+
- v6
67
- master
78
pull_request:
89
workflow_dispatch:
910

1011
jobs:
1112
test:
1213
uses: hapijs/.github/.github/workflows/ci-module.yml@master
14+
with:
15+
min-node-version: 14

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2014-2021, Project contributors
1+
Copyright (c) 2014-2022, Project contributors
22
Copyright (c) 2014-2020, Sideway Inc
33
Copyright (c) 2014, Walmart.
44
All rights reserved.

lib/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ exports.parse = function (definition, options) {
4444
}
4545
}
4646

47-
const args = options.argv || process.argv.slice(2);
47+
const args = options.argv ?? process.argv.slice(2);
4848
let last = null;
4949
const errors = [];
5050
let help = false;
@@ -80,7 +80,7 @@ exports.parse = function (definition, options) {
8080

8181
if (opt.startsWith('no-')) {
8282
const maybeDef = keys[opt.replace('no-', '')];
83-
if (maybeDef && maybeDef.type === 'boolean') {
83+
if (maybeDef?.type === 'boolean') {
8484
booleanNegationDef = maybeDef;
8585
}
8686
}
@@ -89,12 +89,12 @@ exports.parse = function (definition, options) {
8989

9090
if (opt.includes('.')) {
9191
const maybeDef = keys[opt.split('.')[0]];
92-
if (maybeDef && maybeDef.type === 'json') {
92+
if (maybeDef?.type === 'json') {
9393
jsonDef = maybeDef;
9494
}
9595
}
9696

97-
const def = keys[opt] || booleanNegationDef || jsonDef;
97+
const def = keys[opt] ?? booleanNegationDef ?? jsonDef;
9898

9999
if (!def) {
100100
errors.push(internals.formatError('Unknown option:', opt));

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,16 @@
1919
]
2020
},
2121
"dependencies": {
22-
"@hapi/boom": "9.x.x",
23-
"@hapi/bounce": "2.x.x",
24-
"@hapi/bourne": "2.x.x",
25-
"@hapi/hoek": "9.x.x",
26-
"@hapi/validate": "1.x.x"
22+
"@hapi/boom": "^10.0.0",
23+
"@hapi/bounce": "^3.0.0",
24+
"@hapi/bourne": "^3.0.0",
25+
"@hapi/hoek": "^10.0.0",
26+
"@hapi/validate": "^2.0.0"
2727
},
2828
"devDependencies": {
29-
"@hapi/code": "8.x.x",
29+
"@hapi/code": "^9.0.0",
3030
"@hapi/eslint-plugin": "*",
31-
"@hapi/lab": "24.x.x"
31+
"@hapi/lab": "25.0.0-beta.1"
3232
},
3333
"scripts": {
3434
"test": "lab -a @hapi/code -t 100 -L",

0 commit comments

Comments
 (0)