Skip to content

Commit 46d8d62

Browse files
committed
Require Node.js 20
Fixes #23
1 parent 5424b34 commit 46d8d62

File tree

3 files changed

+33
-11
lines changed

3 files changed

+33
-11
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ jobs:
1010
fail-fast: false
1111
matrix:
1212
node-version:
13+
- 24
1314
- 20
14-
- 18
1515
steps:
16-
- uses: actions/checkout@v4
17-
- uses: actions/setup-node@v4
16+
- uses: actions/checkout@v5
17+
- uses: actions/setup-node@v5
1818
with:
1919
node-version: ${{ matrix.node-version }}
2020
- run: npm install

package.json

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@
1212
},
1313
"type": "module",
1414
"exports": "./index.js",
15+
"sideEffects": false,
1516
"engines": {
16-
"node": ">=18"
17+
"node": ">=20"
1718
},
1819
"scripts": {
1920
"test": "xo && ava"
@@ -39,15 +40,15 @@
3940
"esprima"
4041
],
4142
"dependencies": {
42-
"@babel/core": "^7.23.2",
43-
"gulp-plugin-extras": "^0.3.0",
44-
"strip-debug": "^7.0.0"
43+
"@babel/core": "^7.28.4",
44+
"gulp-plugin-extras": "^1.1.0",
45+
"strip-debug": "^8.0.0"
4546
},
4647
"devDependencies": {
47-
"ava": "^5.3.1",
48-
"p-event": "^6.0.0",
49-
"vinyl": "^3.0.0",
50-
"xo": "^0.56.0"
48+
"ava": "^6.4.1",
49+
"p-event": "^7.0.0",
50+
"vinyl": "^3.0.1",
51+
"xo": "^1.2.2"
5152
},
5253
"peerDependencies": {
5354
"gulp": ">=4"

test.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,24 @@ test('strips `console.log()` statements', async t => {
2727
const file = await promise;
2828
t.is(file.contents.toString(), 'function test() {\n void 0;\n}');
2929
});
30+
31+
test('works with ES module import/export statements', async t => {
32+
const stream = stripDebug();
33+
const promise = pEvent(stream, 'data');
34+
35+
stream.end(new Vinyl({
36+
contents: Buffer.from(`import {foo} from './foo.js';
37+
export function test() {
38+
console.log('debug info');
39+
debugger;
40+
return foo();
41+
}`),
42+
}));
43+
44+
const file = await promise;
45+
t.is(file.contents.toString(), `import { foo } from './foo.js';
46+
export function test() {
47+
void 0;
48+
return foo();
49+
}`);
50+
});

0 commit comments

Comments
 (0)