Skip to content

Commit

Permalink
Bump deps
Browse files Browse the repository at this point in the history
  • Loading branch information
OlliV committed Dec 31, 2020
1 parent 90bb055 commit df43e33
Show file tree
Hide file tree
Showing 5 changed files with 1,447 additions and 1,107 deletions.
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,30 +29,30 @@
"devDependencies": {
"@types/bytes": "3.1.0",
"@types/content-type": "1.1.3",
"@types/jest": "25.1.4",
"@types/jest": "26.0.19",
"@types/node": "13.9.1",
"@types/test-listen": "1.1.0",
"@typescript-eslint/eslint-plugin": "2.23.0",
"@typescript-eslint/parser": "2.23.0",
"@typescript-eslint/eslint-plugin": "4.11.1",
"@typescript-eslint/parser": "4.11.1",
"@zeit/fetch-retry": "4.0.1",
"@zeit/git-hooks": "0.1.4",
"@zeit/ncc": "0.21.1",
"bytes": "3.1.0",
"content-type": "1.0.4",
"eslint": "6.8.0",
"eslint-config-prettier": "6.10.0",
"eslint-plugin-prettier": "3.1.2",
"jest": "25.1.0",
"eslint": "7.16.0",
"eslint-config-prettier": "7.1.0",
"eslint-plugin-prettier": "3.3.0",
"jest": "26.6.3",
"node-fetch": "2.6.1",
"prettier": "2.0.1",
"prettier": "2.2.1",
"raw-body": "2.4.1",
"resumer": "0.0.0",
"test-listen": "1.1.0",
"ts-jest": "25.2.1",
"typescript": "3.8.3"
"ts-jest": "26.4.4",
"typescript": "4.1.3"
},
"dependencies": {
"handler-agent": "0.1.1"
"handler-agent": "0.2.0"
},
"jest": {
"preset": "ts-jest",
Expand Down
2 changes: 1 addition & 1 deletion src/body.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export async function text(
}
}

function parseJSON(str: string) {
function parseJSON(str: string): ReturnType<typeof JSON.parse> {
try {
return JSON.parse(str);
} catch (err) {
Expand Down
4 changes: 3 additions & 1 deletion src/serve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ import { MicriError } from './errors';

const { NODE_ENV } = process.env;
const DEV = NODE_ENV === 'development';
const jsonStringify = DEV ? (obj: any) => JSON.stringify(obj, null, 2) : (obj: any) => JSON.stringify(obj);
const jsonStringify = DEV
? (obj: any): string => JSON.stringify(obj, null, 2)
: (obj: any): string => JSON.stringify(obj);

// Returns a `boolean` for whether the argument is a `stream.Readable`.
//
Expand Down
6 changes: 3 additions & 3 deletions src/with-worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import path from 'path';
import { IncomingMessage, ServerResponse } from 'http';
import { buffer } from './body';
import {
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
SHARE_ENV,
Worker,
Expand Down Expand Up @@ -36,9 +36,9 @@ export default function withWorker<OptsType = any>(
return async (req: IncomingMessage, res: ServerResponse, opts: OptsType) => {
const body = await buffer(req, { limit: workerOpts?.limit ?? undefined });

return new Promise((resolve, reject) => {
return new Promise<void>((resolve, reject) => {
const worker = new Worker(trampoline, {
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
env: workerOpts?.env || SHARE_ENV,
eval: true,
Expand Down
Loading

0 comments on commit df43e33

Please sign in to comment.