Skip to content

Commit 1f1ffe9

Browse files
committed
Update build
1 parent 5da360c commit 1f1ffe9

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

.github/workflows/ci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- uses: actions/checkout@v4
1515
- uses: actions/setup-node@v4
1616
with:
17-
node-version: ^20.8
17+
node-version: '22'
1818
- run: |
1919
npm install
2020
gulp make-ts-defs
@@ -35,7 +35,7 @@ jobs:
3535

3636
strategy:
3737
matrix:
38-
node-version: ['16.0.0', '16', '18', '20', '21']
38+
node-version: ['16.0.0', '16', '18', '20', '22']
3939

4040
steps:
4141
- uses: actions/checkout@v4

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
"ansi-colors": "latest",
4343
"c8js": "latest",
4444
"chai": "4",
45+
"eslint-formatter-compact": "latest",
4546
"eslint-plugin-eslint-env": "latest",
4647
"glob": "latest",
4748
"gulp": "latest",

src/polytype-esm.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ const _Function_prototype_hasInstance_call = bindCall(_Function_prototype[_Symb
115115
const _Function_prototype_toString_call = bindCall(_Function_prototype.toString);
116116
const _Object_prototype_valueOf_call = bindCall(_Object.prototype.valueOf);
117117

118-
bindCall = null;
118+
bindCall = null; // eslint-disable-line no-useless-assignment
119119
_Function_prototype_call = null;
120120

121121
const checkDuplicateSuperType =

test/serve.mjs

+7-6
Original file line numberDiff line numberDiff line change
@@ -9,37 +9,38 @@ import { extname, join } from 'node:path';
99
import { fileURLToPath } from 'node:url';
1010
import ansiColors from 'ansi-colors';
1111

12-
const pathDir = fileURLToPath(new URL('..', import.meta.url));
12+
const baseDir = fileURLToPath(new URL('..', import.meta.url));
1313
const mimeTypes =
1414
{
1515
'.css': 'text/css',
1616
'.html': 'text/html',
1717
'.js': 'application/javascript',
18+
'.json': 'application/json',
1819
'.mjs': 'application/javascript',
1920
};
2021
const port = 8080;
2122
createServer
2223
(
2324
({ url }, response) =>
2425
{
25-
const requestPath = fileURLToPath(new URL(url, 'file:'));
26-
if (requestPath === '/favicon.ico')
26+
const { pathname } = new URL(url, 'file:');
27+
if (pathname === '/favicon.ico')
2728
{
2829
const headers = { 'Content-Type': 'image/x-icon' };
2930
response.writeHead(204, headers);
3031
response.end();
3132
return;
3233
}
33-
const pathname = join(pathDir, requestPath);
34-
const stream = createReadStream(pathname);
34+
const fullPath = join(baseDir, pathname);
35+
const stream = createReadStream(fullPath);
3536
stream.on
3637
(
3738
'open',
3839
() =>
3940
{
4041
const headers = { };
4142
{
42-
const ext = extname(requestPath);
43+
const ext = extname(fullPath);
4344
if (mimeTypes.hasOwnProperty(ext))
4445
headers['Content-Type'] = mimeTypes[ext];
4546
}

0 commit comments

Comments
 (0)