chore: clean organization id (#1142)

This commit is contained in:
Ihor Karpiuk
2023-06-26 20:29:16 +03:00
committed by GitHub
parent 78c9119143
commit 04a826272f

View File

@@ -556,9 +556,13 @@ function cleanString(value?: string): string | undefined {
}
export function cleanArgs(args: CommandOptions) {
const keysToClean = ['organization', 'o'];
const result: Record<string, unknown> = {};
for (const [key, value] of Object.entries(args)) {
if (typeof value === 'string') {
if (keysToClean.includes(key)) {
result[key] = '***';
} else if (typeof value === 'string') {
result[key] = cleanString(value);
} else if (Array.isArray(value)) {
result[key] = value.map(cleanString);