Skip to content

Instantly share code, notes, and snippets.

@munierujp
Last active October 5, 2024 00:19
Show Gist options
  • Save munierujp/1314aee36a29268c4cd437d895278119 to your computer and use it in GitHub Desktop.
Save munierujp/1314aee36a29268c4cd437d895278119 to your computer and use it in GitHub Desktop.
export class SensitiveParameter<T> {
private readonly value: T
private readonly masked: string
constructor (value: T, masked: string = '***') {
this.value = value
this.masked = masked
}
/**
* This method always returns masked value.
* @returns masked value
*/
toString (): string {
return this.masked
}
get rawValue (): T {
return this.value
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment