const secrets = new Set < string > ( ) ; export const redactedFields = [ 'authorization' , 'token' , 'githubAppKey' , 'npmToken' , 'npmrc' , 'privateKey' , 'privateKeyOld' , 'gitPrivateKey' , 'forkToken' , 'password' , ] ; export function sanitize ( input ) { if ( ! input ) { return input ; } let output = input ; secrets . forEach ( ( secret ) => { while ( output . includes ( secret ) ) { output = output . replace ( secret , '**redacted**' ) ; } } ) ; return output ; } export function add ( secret ) { secrets . add ( secret ) ; secrets . add ( secret ?. replace ( 'x-access-token:' , '' ) ) ; } export function clear ( ) { secrets . clear ( ) ; }