Skip to content

Commit e928683

Browse files
committed
Use "node:" prefixed imports everywhere.
Update minimum nodejs version to the ones where this feature was introduced, and update CI accordingly. Also bumped the mocha version to the latest one, as that one is still compatible with the now bumped nodejs version.
1 parent bef6570 commit e928683

File tree

10 files changed

+19
-13
lines changed

10 files changed

+19
-13
lines changed

.github/workflows/test.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,21 @@ jobs:
1515
strategy:
1616
fail-fast: false
1717
matrix:
18-
node: [8, 10, 12, 14, 16, 18, 20, 22]
18+
node: [14.18.0, 14, 16.0.0, 16, 18, 20, 22]
1919
os: [ubuntu-latest, windows-latest, macOS-latest]
20+
exclude:
21+
# Node 14 is not available on macos anymore
22+
- os: macos-latest
23+
node-version: 14
24+
- os: macos-latest
25+
node-version: 14.18.0
2026

2127
steps:
2228
- name: Clone repository
2329
uses: actions/checkout@v2
2430

2531
- name: Setup Node.js
26-
uses: actions/setup-node@v2
32+
uses: actions/setup-node@v4
2733
with:
2834
node-version: ${{ matrix.node }}
2935

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
'use strict';
99

10-
const util = require('util');
10+
const util = require('node:util');
1111
const toRegexRange = require('to-regex-range');
1212

1313
const isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val);

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
],
2222
"main": "index.js",
2323
"engines": {
24-
"node": ">=8"
24+
"node": ">=14.18.0 <15 || >=16"
2525
},
2626
"scripts": {
2727
"lint": "eslint --cache --cache-location node_modules/.cache/.eslintcache --report-unused-disable-directives --ignore-path .gitignore .",
@@ -35,7 +35,7 @@
3535
},
3636
"devDependencies": {
3737
"gulp-format-md": "^2.0.0",
38-
"mocha": "^6.1.1",
38+
"mocha": "^10.7.0",
3939
"nyc": "^15.1.0"
4040
},
4141
"keywords": [

test/errors.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
const assert = require('assert');
3+
const assert = require('node:assert');
44
const fill = require('..');
55

66
describe('error handling', () => {

test/invalid.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
const assert = require('assert');
3+
const assert = require('node:assert');
44
const fill = require('..');
55

66
describe('invalid ranges', () => {

test/matching.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
const assert = require('assert');
3+
const assert = require('node:assert');
44
const fill = require('..');
55

66
const toRegex = (...args) => new RegExp(`^(${fill(...args)})$`);

test/options.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
const assert = require('assert');
3+
const assert = require('node:assert');
44
const exact = require('./support/exact');
55
const fill = require('..');
66

test/padding.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
const assert = require('assert').strict;
3+
const assert = require('node:assert').strict;
44
const fill = require('..');
55

66
describe('padding: numbers', () => {

test/support/exact.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22

3-
const assert = require('assert');
4-
const util = require('util');
3+
const assert = require('node:assert');
4+
const util = require('node:util');
55

66
module.exports = (actual, expected) => {
77
assert(Array.isArray(actual));

test/verify-matches.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
'use strict';
99

10-
const assert = require('assert');
10+
const assert = require('node:assert');
1111
const expand = require('./support/expand');
1212
const fill = require('..');
1313
let count = 0;

0 commit comments

Comments
 (0)