mirror of
https://github.com/joinmarket-webui/jam.git
synced 2026-08-20 13:28:21 +02:00
24 lines
557 B
TypeScript
24 lines
557 B
TypeScript
interface DebugFeatures {
|
|
insecureScheduleTesting: boolean
|
|
}
|
|
|
|
const devMode = process.env.NODE_ENV === 'development'
|
|
|
|
const debugFeatures: DebugFeatures = {
|
|
insecureScheduleTesting: true,
|
|
}
|
|
|
|
type DebugFeature = keyof DebugFeatures
|
|
|
|
export const isDebugFeatureEnabled = (name: DebugFeature): boolean => {
|
|
if (!devMode) {
|
|
return false
|
|
}
|
|
|
|
return debugFeatures[name] || false
|
|
}
|
|
|
|
// only to be used in tests
|
|
export const __testSetDebugFeatureEnabled = (name: DebugFeature, enabled: boolean): boolean => {
|
|
return (debugFeatures[name] = enabled)
|
|
}
|