Skip to content

Commit

Permalink
Update build
Browse files Browse the repository at this point in the history
  • Loading branch information
fasttime committed May 18, 2024
1 parent 5da360c commit 1f1ffe9
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ^20.8
node-version: '22'
- run: |
npm install
gulp make-ts-defs
Expand All @@ -35,7 +35,7 @@ jobs:

strategy:
matrix:
node-version: ['16.0.0', '16', '18', '20', '21']
node-version: ['16.0.0', '16', '18', '20', '22']

steps:
- uses: actions/checkout@v4
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"ansi-colors": "latest",
"c8js": "latest",
"chai": "4",
"eslint-formatter-compact": "latest",
"eslint-plugin-eslint-env": "latest",
"glob": "latest",
"gulp": "latest",
Expand Down
2 changes: 1 addition & 1 deletion src/polytype-esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ const _Function_prototype_hasInstance_call = bindCall(_Function_prototype[_Symb
const _Function_prototype_toString_call = bindCall(_Function_prototype.toString);
const _Object_prototype_valueOf_call = bindCall(_Object.prototype.valueOf);

bindCall = null;
bindCall = null; // eslint-disable-line no-useless-assignment
_Function_prototype_call = null;

const checkDuplicateSuperType =
Expand Down
13 changes: 7 additions & 6 deletions test/serve.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,37 +9,38 @@ import { extname, join } from 'node:path';
import { fileURLToPath } from 'node:url';
import ansiColors from 'ansi-colors';

const pathDir = fileURLToPath(new URL('..', import.meta.url));
const baseDir = fileURLToPath(new URL('..', import.meta.url));
const mimeTypes =
{
'.css': 'text/css',
'.html': 'text/html',
'.js': 'application/javascript',
'.json': 'application/json',
'.mjs': 'application/javascript',
};
const port = 8080;
createServer
(
({ url }, response) =>
{
const requestPath = fileURLToPath(new URL(url, 'file:'));
if (requestPath === '/favicon.ico')
const { pathname } = new URL(url, 'file:');
if (pathname === '/favicon.ico')
{
const headers = { 'Content-Type': 'image/x-icon' };
response.writeHead(204, headers);
response.end();
return;
}
const pathname = join(pathDir, requestPath);
const stream = createReadStream(pathname);
const fullPath = join(baseDir, pathname);
const stream = createReadStream(fullPath);
stream.on
(
'open',
() =>
{
const headers = { };
{
const ext = extname(requestPath);
const ext = extname(fullPath);
if (mimeTypes.hasOwnProperty(ext))
headers['Content-Type'] = mimeTypes[ext];
}
Expand Down

0 comments on commit 1f1ffe9

Please sign in to comment.