From bf8c1be28517bee7c638a43a5292b6fd5752c54a Mon Sep 17 00:00:00 2001 From: Joe Ma Date: Sat, 25 Mar 2023 00:34:20 +0800 Subject: [PATCH] Update project dependencies Signed-off-by: Joe Ma --- package.json | 13 ++++++------- src/index.ts | 2 +- tsconfig.json | 17 +++++++++++------ 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/package.json b/package.json index 5372c30..a166c0f 100644 --- a/package.json +++ b/package.json @@ -1,16 +1,15 @@ { "name": "paste", - "version": "1.1", + "version": "1.2", "dependencies": { - "aws4fetch": "^1.0.13", - "nanoid": "^3.3.4", + "aws4fetch": "^1.0.17", + "nanoid": "^4.0.1", "js-sha256": "^0.9.0", "dedent-js": "^1.0.1" }, "devDependencies": { - "@cloudflare/workers-types": "^3.11.0", - "typescript": "^4.7.2", - "wrangler": "^2.0.7", - "@types/mime-types": "^2.1.1" + "@cloudflare/workers-types": "^4.20230321.0", + "typescript": "^5.0.2", + "wrangler": "^2.13.0" } } diff --git a/src/index.ts b/src/index.ts index 0232403..f5902eb 100644 --- a/src/index.ts +++ b/src/index.ts @@ -101,7 +101,7 @@ export default { // Content-Type: multipart/form-data if (content_type.includes('multipart/form-data')) { const formdata = await request.formData(); - const data = formdata.get('u'); + const data: File | string | any = formdata.get('u'); const type = formdata.get('paste-type'); const file_title = formdata.get('title'); if (data === null) { diff --git a/tsconfig.json b/tsconfig.json index 2591fb1..fc1cb5b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,10 +11,12 @@ // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ /* Language and Environment */ - "target": "es2021" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */, + "target": "esnext" + /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */, "lib": [ - "es2021" - ] /* Specify a set of bundled library declaration files that describe the target runtime environment. */, + "esnext" + ] + /* Specify a set of bundled library declaration files that describe the target runtime environment. */, // "jsx": "preserve", /* Specify what JSX code is generated. */ // "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */ // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ @@ -26,16 +28,19 @@ // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ /* Modules */ - "module": "es2022" /* Specify what module code is generated. */, + "module": "esnext" + /* Specify what module code is generated. */, // "rootDir": "./", /* Specify the root folder within your source files. */ - "moduleResolution": "node" /* Specify how TypeScript looks up a file from a given module specifier. */, + "moduleResolution": "node" + /* Specify how TypeScript looks up a file from a given module specifier. */, // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ // "typeRoots": [], /* Specify multiple folders that act like `./node_modules/@types`. */ "types": [ "@cloudflare/workers-types" - ] /* Specify type package names to be included without being referenced in a source file. */, + ] + /* Specify type package names to be included without being referenced in a source file. */, // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ "resolveJsonModule": true /* Enable importing .json files */, // "noResolve": true, /* Disallow `import`s, `require`s or ``s from expanding the number of files TypeScript should add to a project. */