mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 04:27:21 +00:00
added basic cli telemetry
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
export type Env = {};
|
||||
|
||||
export const is_toggled = (given: unknown): boolean => {
|
||||
return typeof given === "string" ? [1, "1", "true"].includes(given) : Boolean(given);
|
||||
export const is_toggled = (given: unknown, fallback?: boolean): boolean => {
|
||||
return typeof given === "string" ? [1, "1", "true"].includes(given) : Boolean(fallback);
|
||||
};
|
||||
|
||||
export function isDebug(): boolean {
|
||||
@@ -34,6 +34,13 @@ const envs = {
|
||||
return typeof v === "string" ? v : undefined;
|
||||
},
|
||||
},
|
||||
// cli telemetry
|
||||
cli_telemetry: {
|
||||
key: "BKND_CLI_TELEMETRY",
|
||||
validate: (v: unknown) => {
|
||||
return is_toggled(v, true);
|
||||
},
|
||||
},
|
||||
// module manager debug: {
|
||||
modules_debug: {
|
||||
key: "BKND_MODULES_DEBUG",
|
||||
|
||||
Reference in New Issue
Block a user