Skip to content

Commit

Permalink
Support node v18, drop node v12 (#295)
Browse files Browse the repository at this point in the history
  • Loading branch information
devinivy committed May 2, 2022
1 parent 948268e commit a89e2ba
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci-module.yml
Expand Up @@ -3,10 +3,13 @@ name: ci
on:
push:
branches:
- v10
- master
pull_request:
workflow_dispatch:

jobs:
test:
uses: hapijs/.github/.github/workflows/ci-module.yml@master
with:
min-node-version: 14
5 changes: 3 additions & 2 deletions LICENSE.md
@@ -1,5 +1,6 @@
Copyright (c) 2012-2020, Sideway Inc, and project contributors
Copyright (c) 2012-2014, Walmart.
Copyright (c) 2012-2022, Project contributors
Copyright (c) 2012-2020, Sideway Inc
Copyright (c) 2012-2014, Walmart.
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Expand Down
11 changes: 3 additions & 8 deletions lib/index.js
Expand Up @@ -123,7 +123,7 @@ exports.boomify = function (err, options) {
}

if (!err.isBoom) {
return internals.initialize(err, options.statusCode || 500, options.message);
return internals.initialize(err, options.statusCode ?? 500, options.message);
}

if (options.override === false || // Defaults to true
Expand All @@ -132,7 +132,7 @@ exports.boomify = function (err, options) {
return err;
}

return internals.initialize(err, options.statusCode || err.output.statusCode, options.message);
return internals.initialize(err, options.statusCode ?? err.output.statusCode, options.message);
};


Expand Down Expand Up @@ -179,12 +179,7 @@ exports.unauthorized = function (message, scheme, attributes) { // Or (
else {
wwwAuthenticate += ' ' + Object.keys(attributes).map((name) => {

let value = attributes[name];
if (value === null ||
value === undefined) {

value = '';
}
const value = attributes[name] ?? '';

err.output.payload.attributes[name] = value;
return `${name}="${Hoek.escapeHeaderAttribute(value.toString())}"`;
Expand Down
9 changes: 5 additions & 4 deletions package.json
Expand Up @@ -18,13 +18,14 @@
]
},
"dependencies": {
"@hapi/hoek": "9.x.x"
"@hapi/hoek": "10.x.x"
},
"devDependencies": {
"@hapi/code": "8.x.x",
"@hapi/code": "9.x.x",
"@hapi/eslint-plugin": "*",
"@hapi/lab": "24.x.x",
"typescript": "~4.0.2"
"@hapi/lab": "25.0.0-beta.1",
"@types/node": "^17.0.30",
"typescript": "~4.6.4"
},
"scripts": {
"test": "lab -a @hapi/code -t 100 -L -Y",
Expand Down

0 comments on commit a89e2ba

Please sign in to comment.