MCPcopy Create free account
hub / github.com/dailydotdev/apps / redactSensitiveQueryParams

Function redactSensitiveQueryParams

packages/shared/src/lib/sensitiveQuery.ts:20–34  ·  view source on GitHub ↗
(
  query: T | null | undefined,
)

Source from the content-addressed store, hash-verified

18 SENSITIVE_QUERY_PARAMS.some((param) => typeof query[param] !== 'undefined');
19
20export const redactSensitiveQueryParams = <T extends Record<string, unknown>>(
21 query: T | null | undefined,
22): T => {
23 if (!query || typeof query !== 'object') {
24 return {} as T;
25 }
26
27 return Object.keys(query).reduce(
28 (acc, key) =>
29 (SENSITIVE_QUERY_PARAMS as readonly string[]).includes(key)
30 ? { ...acc, [key]: REDACTED_VALUE }
31 : acc,
32 query,
33 );
34};

Callers 2

useLogSharedPropsFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected