enabled()
function enabled(key: string): boolean;
Defined in: src/lib/dev.ts:85
Checks if a module should be enabled based on dev mode settings.
Returns true if:
- Dev mode is disabled (all modules load normally), OR
- Dev mode is enabled but no filter is set (ONLY is empty), OR
- Dev mode is enabled and the module is in the ONLY set
Parameters
| Parameter | Type | Description |
|---|---|---|
key | string | The module name/key to check. |
Returns
boolean
Whether the module should be loaded.
Example
// In module loader
for (const key of MODULE_ORDER) {
if (!enabled(key)) {
console.log(`Skipping ${key} - dev mode filter`);
continue;
}
// Load the module...
}