mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-10-27 16:22:11 +08:00
refactor: knip cleanup (#7468)
* chore(frontend): expand Knip reports * chore: remove unused Mihomo changelog sync script * refactor: remove unused value exports * refactor: remove unused type exports * refactor: remove circular route dependencies * chore(frontend): move Knip scope to config * chore(i18n): remove stale portable update message
This commit is contained in:
+2
-11
@@ -4,9 +4,7 @@
|
||||
* - env flag `VITE_ENABLE_DEBUG_LOGS` is truthy (1/true/yes)
|
||||
* - page sets `window.__VERGE_ENABLE_DEBUG_LOGS__ = true`
|
||||
* - localStorage item `VERGE_DEBUG_LOGS` is truthy (1/true/yes)
|
||||
* Use `setDebugLoggingEnabled` to force-enable/disable at runtime.
|
||||
*/
|
||||
let runtimeOverride: boolean | undefined
|
||||
let cachedDebugEnabled: boolean | undefined
|
||||
|
||||
const parseStringFlag = (value: unknown) => {
|
||||
@@ -46,15 +44,8 @@ const computeDebugEnabled = (): boolean => {
|
||||
return false
|
||||
}
|
||||
|
||||
export const setDebugLoggingEnabled = (enabled: boolean) => {
|
||||
runtimeOverride = enabled
|
||||
cachedDebugEnabled = enabled
|
||||
}
|
||||
|
||||
export const isDebugLoggingEnabled = () =>
|
||||
runtimeOverride ??
|
||||
cachedDebugEnabled ??
|
||||
(cachedDebugEnabled = computeDebugEnabled())
|
||||
const isDebugLoggingEnabled = () =>
|
||||
cachedDebugEnabled ?? (cachedDebugEnabled = computeDebugEnabled())
|
||||
|
||||
/**
|
||||
* Logs to the console only when debug logging is enabled.
|
||||
|
||||
@@ -9,7 +9,7 @@ export type CompileStringMatcherResult = {
|
||||
isValid: boolean
|
||||
}
|
||||
|
||||
export const escapeRegex = (value: string) => {
|
||||
const escapeRegex = (value: string) => {
|
||||
return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user