Skip to content

Commit 3a2cc0f

Browse files
authored
Support node v18 and drop node v12 (#377)
* Support node v18, drop node v12 * Test on node 14+
1 parent 71250a0 commit 3a2cc0f

File tree

7 files changed

+14
-12
lines changed

7 files changed

+14
-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+
- v10
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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Copyright (c) 2011-2020, Sideway Inc, and project contributors
2-
Copyright (c) 2011-2014, Walmart
1+
Copyright (c) 2011-2022, Sideway Inc, and project contributors
2+
Copyright (c) 2011-2014, Walmart
33
Copyright (c) 2011, Yahoo Inc.
44

55
All rights reserved.

lib/contain.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ internals.array = function (ref, values, options) {
7979
}
8080
}
8181
else {
82-
compare = compare || internals.compare(options);
82+
compare = compare ?? internals.compare(options);
8383

8484
let found = false;
8585
for (const [key, existing] of map.entries()) {
@@ -108,7 +108,7 @@ internals.array = function (ref, values, options) {
108108
match = map.get(item);
109109
}
110110
else {
111-
compare = compare || internals.compare(options);
111+
compare = compare ?? internals.compare(options);
112112

113113
for (const [key, existing] of map.entries()) {
114114
if (compare(key, item)) {

lib/deepEqual.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,7 @@ internals.isDeepEqualObj = function (instanceType, obj, ref, options, seen) {
271271
const refSymbols = new Set(getOwnPropertySymbols(ref));
272272

273273
for (const key of objSymbols) {
274-
if (!options.skip ||
275-
!options.skip.includes(key)) {
274+
if (!options.skip?.includes(key)) {
276275

277276
if (hasOwnEnumerableProperty(obj, key)) {
278277
if (!hasOwnEnumerableProperty(ref, key)) {

lib/isPromise.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ const internals = {};
55

66
module.exports = function (promise) {
77

8-
return !!promise && typeof promise.then === 'function';
8+
return typeof promise?.then === 'function';
99
};

lib/reachTemplate.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ module.exports = function (obj, template, options) {
1111
return template.replace(/{([^{}]+)}/g, ($0, chain) => {
1212

1313
const value = Reach(obj, chain, options);
14-
return (value === undefined || value === null ? '' : value);
14+
return value ?? '';
1515
});
1616
};

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
"plugin:@hapi/module"
1717
]
1818
},
19-
"dependencies": {},
2019
"devDependencies": {
21-
"@hapi/code": "8.x.x",
20+
"@hapi/code": "9.0.0-beta.0",
2221
"@hapi/eslint-plugin": "*",
23-
"@hapi/lab": "^24.0.0",
24-
"typescript": "~4.0.2"
22+
"@hapi/lab": "25.0.0-beta.1",
23+
"@types/node": "^17.0.30",
24+
"typescript": "~4.6.4"
2525
},
2626
"scripts": {
2727
"test": "lab -a @hapi/code -t 100 -L -Y",

0 commit comments

Comments
 (0)