Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Remove redundant initializer #2502

Merged
merged 1 commit into from
Apr 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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