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 // The `close` event is used because the process is guaranteed to have completed writing to
252 // stdout and stderr, using the `exit` event can cause inconsistent information in stdout and
253 // stderr due to a race condition around exiting.
254 childProcess.on('close', (exitCode, signal) => {
255 const exitDescription = exitCode !== null ? `exit code "${exitCode}"` : `signal "${signal}"`;
256 const status = statusFromExitCodeAndSignal(exitCode, signal);
257 const printFn = status !== 0 && options.mode === 'on-error' ? Log.error : Log.debug;
258 printFn(`Command "${sanitize(command)}" completed with ${exitDescription}.`);
259 if (!options.sensitiveOutput) {
260 printFn(`Process output: \n${sanitize(logOutput)}`);
261 }

Callers 3

spawnInteractiveFunction · 0.85
spawnSyncFunction · 0.85
processAsyncCmdFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected