in env/secrets/src/secrets.lib.ts [26:54]
public static parseArguments(args: string[], operation: "add" | "remove"): Record<string, string> {
const result: Record<string, string> = {};
if (operation === "add") {
let currentKey: string | null = null;
let currentValue = "";
for (const arg of args) {
if (arg.includes("=")) {
if (currentKey !== null) {
result[currentKey] = currentValue.trim();
}
const [key, value = ""] = arg.split("=", 2);
currentKey = key.toUpperCase().trim();
currentValue = value;
} else {
currentValue += ` ${arg}`;
}
}
if (currentKey !== null) {
result[currentKey] = currentValue.trim();
}
} else if (operation === "remove") {
for (const arg of args) {
result[arg.toUpperCase().trim()] = "";
}
}
return result;
}