mirror of
https://github.com/honojs/hono.git
synced 2024-11-21 10:08:58 +01:00
refactor: compare with undefined directly (#3602)
This commit is contained in:
parent
c88ead6d72
commit
1af7e58ae0
@ -57,11 +57,11 @@ export class Trie {
|
||||
const paramReplacementMap: ReplacementMap = []
|
||||
|
||||
regexp = regexp.replace(/#(\d+)|@(\d+)|\.\*\$/g, (_, handlerIndex, paramIndex) => {
|
||||
if (typeof handlerIndex !== 'undefined') {
|
||||
if (handlerIndex !== undefined) {
|
||||
indexReplacementMap[++captureIndex] = Number(handlerIndex)
|
||||
return '$()'
|
||||
}
|
||||
if (typeof paramIndex !== 'undefined') {
|
||||
if (paramIndex !== undefined) {
|
||||
paramReplacementMap[Number(paramIndex)] = ++captureIndex
|
||||
return ''
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ export function getColorEnabled(): boolean {
|
||||
const isNoColor =
|
||||
typeof Deno?.noColor === 'boolean'
|
||||
? (Deno.noColor as boolean)
|
||||
: typeof process !== 'undefined'
|
||||
: process !== undefined
|
||||
? // eslint-disable-next-line no-unsafe-optional-chaining
|
||||
'NO_COLOR' in process?.env
|
||||
: false
|
||||
|
Loading…
Reference in New Issue
Block a user