diff --git a/src/router/reg-exp-router/trie.ts b/src/router/reg-exp-router/trie.ts index d7b146cf..39bf99f7 100644 --- a/src/router/reg-exp-router/trie.ts +++ b/src/router/reg-exp-router/trie.ts @@ -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 '' } diff --git a/src/utils/color.ts b/src/utils/color.ts index 7e6d7b8b..522d3460 100644 --- a/src/utils/color.ts +++ b/src/utils/color.ts @@ -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