Spracherkennung für: .ts vermutete Sprache: Unknown {[0] [0] [0]} [Methode: Schwerpunktbildung, einfache Gewichte, sechs Dimensionen]
import { isPlainObject } from "../infra/plain-object.js";
import type { CommandsConfig } from "./types.js";
export type CommandFlagKey = {
[K in keyof CommandsConfig]-?: Exclude<CommandsConfig[K], undefined> extends boolean ? K : never;
}[keyof CommandsConfig];
function getOwnCommandFlagValue(
config: { commands?: unknown } | undefined,
key: CommandFlagKey,
): unknown {
const { commands } = config ?? {};
if (!isPlainObject(commands) || !Object.hasOwn(commands, key)) {
return undefined;
}
return commands[key];
}
export function isCommandFlagEnabled(
config: { commands?: unknown } | undefined,
key: CommandFlagKey,
): boolean {
return getOwnCommandFlagValue(config, key) === true;
}
export function isRestartEnabled(config?: { commands?: unknown }): boolean {
return getOwnCommandFlagValue(config, "restart") !== false;
}
¤ Dauer der Verarbeitung: 0.17 Sekunden
(vorverarbeitet am 2026-04-27)
¤
*© Formatika GbR, Deutschland