Skip to content
Myr

refactor: Remove redundant initializer (#2502)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by TATSUNO “Taz” Yasuhiro · committed by GitHub · parent 7e113f3 · Browse files · 7 files+7 added−9 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

7 files+7 added−9 removed

  • other:+7 added−9 removed

7 files+7 added−9 removed

modified:deno_dist/client/client.ts+1 added-2 removed
modified:deno_dist/helper/ssg/ssg.ts+1 added-1 removed
269 unmodified lines
270 * `toSSG` is an experimental feature.271 * The API might be changed.272 */273export const toSSG: ToSSGInterface = async (app, fs, options) => {274 let result: ToSSGResult | undefined = undefined274 let result: ToSSGResult | undefined275 const getInfoPromises: Promise<unknown>[] = []276 const savePromises: Promise<string | undefined>[] = []277 try {278 const outputDir = options?.dir ?? './static'
38 unmodified lines
modified:deno_dist/middleware/serve-static/index.ts+1 added-1 removed
66 unmodified lines
67 }68 }6970 if (content) {71 let mimeType: string | undefined = undefined71 let mimeType: string | undefined72 if (options.mimes) {73 mimeType = getMimeType(path, options.mimes) ?? getMimeType(path)74 } else {75 mimeType = getMimeType(path)
12 unmodified lines
modified:src/adapter/cloudflare-workers/utils.ts+1 added-1 removed
10 unmodified lines
11export const getContentFromKVAsset = async (12 path: string,13 options?: KVAssetOptions14): Promise<ArrayBuffer | null> => {15 let ASSET_MANIFEST: Record<string, string> = {}15 let ASSET_MANIFEST: Record<string, string>1617 if (options && options.manifest) {18 if (typeof options.manifest === 'string') {19 ASSET_MANIFEST = JSON.parse(options.manifest)
29 unmodified lines
modified:src/client/client.ts+1 added-2 removed
82 unmodified lines
83 }84 }8586 let methodUpperCase = this.method.toUpperCase()87 let setBody = !(methodUpperCase === 'GET' || methodUpperCase === 'HEAD')8788 const headerValues: Record<string, string> = {89 ...(args?.header ?? {}),90 ...(typeof opt?.headers === 'function'
24 unmodified lines
115 if (this.queryParams) {116 url = url + '?' + this.queryParams.toString()117 }118 methodUpperCase = this.method.toUpperCase()120 setBody = !(methodUpperCase === 'GET' || methodUpperCase === 'HEAD')119 const setBody = !(methodUpperCase === 'GET' || methodUpperCase === 'HEAD')120121 // Pass URL string to 1st arg for testing with MSW and node-fetch122 return (opt?.fetch || fetch)(url, {123 body: setBody ? this.rBody : undefined,
47 unmodified lines
modified:src/helper/ssg/ssg.ts+1 added-1 removed
269 unmodified lines
270 * `toSSG` is an experimental feature.271 * The API might be changed.272 */273export const toSSG: ToSSGInterface = async (app, fs, options) => {274 let result: ToSSGResult | undefined = undefined274 let result: ToSSGResult | undefined275 const getInfoPromises: Promise<unknown>[] = []276 const savePromises: Promise<string | undefined>[] = []277 try {278 const outputDir = options?.dir ?? './static'
38 unmodified lines
modified:src/middleware/serve-static/index.ts+1 added-1 removed
66 unmodified lines
67 }68 }6970 if (content) {71 let mimeType: string | undefined = undefined71 let mimeType: string | undefined72 if (options.mimes) {73 mimeType = getMimeType(path, options.mimes) ?? getMimeType(path)74 } else {75 mimeType = getMimeType(path)
12 unmodified lines