Skip to content

Commit

Permalink
refactor: Remove redundant initializer (#2502)
Browse files Browse the repository at this point in the history
  • Loading branch information
exoego committed Apr 13, 2024
1 parent 7e113f3 commit fb31c8a
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 9 deletions.
3 changes: 1 addition & 2 deletions deno_dist/client/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ class ClientRequestImpl {
}

let methodUpperCase = this.method.toUpperCase()
let setBody = !(methodUpperCase === 'GET' || methodUpperCase === 'HEAD')

const headerValues: Record<string, string> = {
...(args?.header ?? {}),
Expand Down Expand Up @@ -117,7 +116,7 @@ class ClientRequestImpl {
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, {
Expand Down
2 changes: 1 addition & 1 deletion deno_dist/helper/ssg/ssg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ export interface ToSSGAdaptorInterface<
* The API might be changed.
*/
export const toSSG: ToSSGInterface = async (app, fs, options) => {
let result: ToSSGResult | undefined = undefined
let result: ToSSGResult | undefined
const getInfoPromises: Promise<unknown>[] = []
const savePromises: Promise<string | undefined>[] = []
try {
Expand Down
2 changes: 1 addition & 1 deletion deno_dist/middleware/serve-static/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export const serveStatic = <E extends Env = Env>(
}

if (content) {
let mimeType: string | undefined = undefined
let mimeType: string | undefined
if (options.mimes) {
mimeType = getMimeType(path, options.mimes) ?? getMimeType(path)
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/adapter/cloudflare-workers/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const getContentFromKVAsset = async (
path: string,
options?: KVAssetOptions
): Promise<ArrayBuffer | null> => {
let ASSET_MANIFEST: Record<string, string> = {}
let ASSET_MANIFEST: Record<string, string>

if (options && options.manifest) {
if (typeof options.manifest === 'string') {
Expand Down
3 changes: 1 addition & 2 deletions src/client/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ class ClientRequestImpl {
}

let methodUpperCase = this.method.toUpperCase()
let setBody = !(methodUpperCase === 'GET' || methodUpperCase === 'HEAD')

const headerValues: Record<string, string> = {
...(args?.header ?? {}),
Expand Down Expand Up @@ -117,7 +116,7 @@ class ClientRequestImpl {
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, {
Expand Down
2 changes: 1 addition & 1 deletion src/helper/ssg/ssg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ export interface ToSSGAdaptorInterface<
* The API might be changed.
*/
export const toSSG: ToSSGInterface = async (app, fs, options) => {
let result: ToSSGResult | undefined = undefined
let result: ToSSGResult | undefined
const getInfoPromises: Promise<unknown>[] = []
const savePromises: Promise<string | undefined>[] = []
try {
Expand Down
2 changes: 1 addition & 1 deletion src/middleware/serve-static/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export const serveStatic = <E extends Env = Env>(
}

if (content) {
let mimeType: string | undefined = undefined
let mimeType: string | undefined
if (options.mimes) {
mimeType = getMimeType(path, options.mimes) ?? getMimeType(path)
} else {
Expand Down

0 comments on commit fb31c8a

Please sign in to comment.