Skip to content

Commit 7f4b30b

Browse files
committed
Require Node.js 18
1 parent c7c923c commit 7f4b30b

File tree

4 files changed

+13
-11
lines changed

4 files changed

+13
-11
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@ jobs:
1010
fail-fast: false
1111
matrix:
1212
node-version:
13+
- 20
1314
- 18
14-
- 16
15-
- 14
1615
steps:
1716
- uses: actions/checkout@v4
1817
- uses: actions/setup-node@v4

core.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {Buffer} from 'node:buffer';
22
import * as Token from 'token-types';
3-
import * as strtok3 from 'strtok3/core'; // eslint-disable-line n/file-extension-in-import
3+
import * as strtok3 from 'strtok3/core';
44
import {
55
stringToBytes,
66
tarHeaderChecksumMatches,
@@ -794,7 +794,7 @@ export class FileTypeParser {
794794
const element = await readElement();
795795
if (element.id === 0x42_82) {
796796
const rawValue = await tokenizer.readToken(new Token.StringType(element.len, 'utf-8'));
797-
return rawValue.replace(/\00.*$/g, ''); // Return DocType
797+
return rawValue.replaceAll(/\00.*$/g, ''); // Return DocType
798798
}
799799

800800
await tokenizer.ignore(element.len); // ignore payload

package.json

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
},
2121
"sideEffects": false,
2222
"engines": {
23-
"node": ">=14.16"
23+
"node": ">=18"
2424
},
2525
"scripts": {
2626
"test": "xo && ava && tsd"
@@ -216,18 +216,21 @@
216216
},
217217
"devDependencies": {
218218
"@tokenizer/token": "^0.3.0",
219-
"@types/node": "^20.1.2",
220-
"ava": "^5.2.0",
219+
"@types/node": "^20.10.7",
220+
"ava": "^6.0.1",
221221
"commonmark": "^0.30.0",
222222
"noop-stream": "^1.0.0",
223-
"tsd": "^0.28.1",
224-
"xo": "^0.54.2"
223+
"tsd": "^0.30.3",
224+
"xo": "^0.56.0"
225225
},
226226
"xo": {
227227
"envs": [
228228
"node",
229229
"browser"
230230
],
231+
"ignores": [
232+
"fixture"
233+
],
231234
"rules": {
232235
"no-inner-declarations": "warn",
233236
"no-await-in-loop": "warn",

test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import process from 'node:process';
2-
import {Buffer, Blob} from 'node:buffer';
2+
import {Buffer} from 'node:buffer';
33
import path from 'node:path';
44
import {fileURLToPath} from 'node:url';
55
import fs from 'node:fs';
66
import stream from 'node:stream';
77
import test from 'ava';
88
import {readableNoopStream} from 'noop-stream';
99
import {Parser as ReadmeParser} from 'commonmark';
10-
import * as strtok3 from 'strtok3/core'; // eslint-disable-line n/file-extension-in-import
10+
import * as strtok3 from 'strtok3/core';
1111
import {
1212
fileTypeFromBuffer,
1313
fileTypeFromStream,

0 commit comments

Comments
 (0)