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
Provenance
- Commit
fb31c8a- Tree
2e1eb88- Author
TATSUNO “Taz” Yasuhiro <ytatsuno.jp@gmail.com>- Committer
GitHub <noreply@github.com>- Parent
7e113f3
7 files changed+7 added−9 removed
modified:deno_dist/client/client.ts+1 added-2 removed
82 unmodified lines83848586878788899024 unmodified lines11511611711812011912012112212347 unmodified lines82 unmodified lines } }
let methodUpperCase = this.method.toUpperCase() let setBody = !(methodUpperCase === 'GET' || methodUpperCase === 'HEAD')
const headerValues: Record<string, string> = { ...(args?.header ?? {}), ...(typeof opt?.headers === 'function'24 unmodified lines if (this.queryParams) { url = url + '?' + this.queryParams.toString() } methodUpperCase = this.method.toUpperCase() setBody = !(methodUpperCase === 'GET' || methodUpperCase === 'HEAD') const setBody = !(methodUpperCase === 'GET' || methodUpperCase === 'HEAD')
// Pass URL string to 1st arg for testing with MSW and node-fetch return (opt?.fetch || fetch)(url, { body: setBody ? this.rBody : undefined,47 unmodified linesmodified:deno_dist/helper/ssg/ssg.ts+1 added-1 removed
269 unmodified lines270 * `toSSG` is an experimental feature.271 * The API might be changed.272 */273 export 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 linesmodified:deno_dist/middleware/serve-static/index.ts+1 added-1 removed
66 unmodified lines67 }68 }69 70 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 linesmodified:src/adapter/cloudflare-workers/utils.ts+1 added-1 removed
10 unmodified lines11 export 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>16 17 if (options && options.manifest) {18 if (typeof options.manifest === 'string') {19 ASSET_MANIFEST = JSON.parse(options.manifest)29 unmodified linesmodified:src/client/client.ts+1 added-2 removed
82 unmodified lines83 }84 }85 86 let methodUpperCase = this.method.toUpperCase()87- let setBody = !(methodUpperCase === 'GET' || methodUpperCase === 'HEAD')87 88 const headerValues: Record<string, string> = {89 ...(args?.header ?? {}),90 ...(typeof opt?.headers === 'function'24 unmodified lines115 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')120 121 // 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 linesmodified:src/helper/ssg/ssg.ts+1 added-1 removed
269 unmodified lines270 * `toSSG` is an experimental feature.271 * The API might be changed.272 */273 export 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 linesmodified:src/middleware/serve-static/index.ts+1 added-1 removed
66 unmodified lines67 }68 }69 70 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