/
githubmirror
/
client
Обзор
Документация
Войти
/
githubmirror
/
client
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
shared/util/hidden-string.tsx
33 строки
755 B
chrisnojima-zoom
Version 670 - clean2 (#29122)
08 июн 2026, 19:31
Не верифицирован
08 июн 2026, 19:31
1943197
Код
Авторство
О чём код?
// HiddenString tries to wrap a string value to prevent it from being easily // output as a string to log, file or console. const valueKey = Symbol('valueKey') type WithValue = {[valueKey]: string} export class HiddenString { constructor(stringValue: string) { Object.defineProperty(this, valueKey, { configurable: false, enumerable: false, value: stringValue, writable: false, }) } stringValue() { return (this as unknown as WithValue)[valueKey] } equals(other: HiddenString) { return (this as unknown as WithValue)[valueKey] === (other as unknown as WithValue)[valueKey] } toString() { return '[HiddenString]' } toJSON() { return '[HiddenString]' } } export default HiddenString