Skip to content

Commit

Permalink
Use "node:" prefixed imports everywhere.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
boenrobot committed Jul 26, 2024
1 parent bef6570 commit 14d4218
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 13 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,21 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [8, 10, 12, 14, 16, 18, 20, 22]
node: [14.18.0, 14, 16.0.0, 16, 18, 20, 22]
os: [ubuntu-latest, windows-latest, macOS-latest]
exclude:
# Node 14 is not available on macos anymore
- os: macos-latest
node: 14
- os: macos-latest
node: 14.18.0

steps:
- name: Clone repository
uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}

Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

'use strict';

const util = require('util');
const util = require('node:util');
const toRegexRange = require('to-regex-range');

const isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val);
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
],
"main": "index.js",
"engines": {
"node": ">=8"
"node": ">=14.18.0 <15 || >=16"
},
"scripts": {
"lint": "eslint --cache --cache-location node_modules/.cache/.eslintcache --report-unused-disable-directives --ignore-path .gitignore .",
Expand All @@ -35,7 +35,7 @@
},
"devDependencies": {
"gulp-format-md": "^2.0.0",
"mocha": "^6.1.1",
"mocha": "^10.7.0",
"nyc": "^15.1.0"
},
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion test/errors.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

const assert = require('assert');
const assert = require('node:assert');
const fill = require('..');

describe('error handling', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/invalid.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

const assert = require('assert');
const assert = require('node:assert');
const fill = require('..');

describe('invalid ranges', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/matching.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

const assert = require('assert');
const assert = require('node:assert');
const fill = require('..');

const toRegex = (...args) => new RegExp(`^(${fill(...args)})$`);
Expand Down
2 changes: 1 addition & 1 deletion test/options.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

const assert = require('assert');
const assert = require('node:assert');
const exact = require('./support/exact');
const fill = require('..');

Expand Down
2 changes: 1 addition & 1 deletion test/padding.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

const assert = require('assert').strict;
const assert = require('node:assert').strict;
const fill = require('..');

describe('padding: numbers', () => {
Expand Down
4 changes: 2 additions & 2 deletions test/support/exact.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

const assert = require('assert');
const util = require('util');
const assert = require('node:assert');
const util = require('node:util');

module.exports = (actual, expected) => {
assert(Array.isArray(actual));
Expand Down
2 changes: 1 addition & 1 deletion test/verify-matches.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

'use strict';

const assert = require('assert');
const assert = require('node:assert');
const expand = require('./support/expand');
const fill = require('..');
let count = 0;
Expand Down

0 comments on commit 14d4218

Please sign in to comment.