MCPcopy Create free account
hub / github.com/angular/dev-infra / sanitize

Function sanitize

ng-dev/utils/child-process.ts:253–258  ·  view source on GitHub ↗

Sanitizes a string by redacting URL credentials.

(value: string | null | undefined)

Source from the content-addressed store, hash-verified

251
252/** Sanitizes a string by redacting URL credentials. */
253function sanitize(value: string | null | undefined): string {
254 if (!value) {
255 return '';
256 }
257 return value.replace(/(https?:\/\/)([^@:/]*)(:[^@/]+)?@/g, '$1<TOKEN>@');
258}

Callers 3

spawnInteractiveFunction · 0.85
spawnSyncFunction · 0.85
processAsyncCmdFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected