From 6b15d374e72b901818843b0eee050230a16f53a8 Mon Sep 17 00:00:00 2001 From: emily-shen <69125074+emily-shen@users.noreply.github.com> Date: Thu, 13 Feb 2025 13:36:24 +0000 Subject: [PATCH] fixups --- packages/wrangler/src/metrics/metrics-dispatcher.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/wrangler/src/metrics/metrics-dispatcher.ts b/packages/wrangler/src/metrics/metrics-dispatcher.ts index 1b2e192cab1f..6d3e494ddca8 100644 --- a/packages/wrangler/src/metrics/metrics-dispatcher.ts +++ b/packages/wrangler/src/metrics/metrics-dispatcher.ts @@ -272,7 +272,6 @@ export const redactArgValues = ( for (let [key, value] of Object.entries(args)) { key = normalise(key); - // the default is not set by yargs :/ if (key === "xIncludeRuntime" && value === "") { value = ".wrangler/types/runtime.d.ts"; } @@ -283,16 +282,20 @@ export const redactArgValues = ( if ( typeof value === "number" || typeof value === "boolean" || - allowedValuesForArg.includes(normalise(key)) + allowedValuesForArg.includes(key) ) { result[key] = value; } else if ( + // redact if its a string, unless the value is in the allow list + // * is a special value that allows all values for that arg typeof value === "string" && !(allowedValuesForArg === "*" || allowedValuesForArg.includes(value)) ) { result[key] = ""; } else if (Array.isArray(value)) { result[key] = value.map((v) => + // redact if its a string, unless the value is in the allow list + // * is a special value that allows all values for that arg typeof v === "string" && !(allowedValuesForArg === "*" || allowedValuesForArg.includes(v)) ? ""