Skip to content

Commit

Permalink
fixups
Browse files Browse the repository at this point in the history
  • Loading branch information
emily-shen committed Feb 13, 2025
1 parent 66cf722 commit 6b15d37
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/wrangler/src/metrics/metrics-dispatcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
Expand All @@ -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] = "<REDACTED>";
} 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))
? "<REDACTED>"
Expand Down

0 comments on commit 6b15d37

Please sign in to comment.