Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support node v18, drop node v12 #295

Merged
merged 1 commit into from May 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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