export function hideTokenFromString ( str ) { if ( ! ( str && typeof str === 'string' ) ) return '' ; return str . replace ( /((token=|token[\"]?[:]?[\"]?|Authorization[\"]?:)[\\]?["']?)([A-Za-z0-9\.\-_ ]+)/gi , '$1REDACTED' ) ; }