pretty-var-export
Version:
Export any value to valid and equivalent JavaScript code
18 lines (15 loc) • 447 B
text/typescript
import colors from '../../colors/colors';
import StringHandler from '../String/StringHandler';
const SymbolHandler = {
test: (value: unknown) => typeof value === 'symbol',
format: (symbol: symbol) => {
const description =
symbol.description === undefined
? ''
: StringHandler.format(symbol.description);
return (
colors.constructor('Symbol(') + description + colors.constructor(')')
);
},
};
export default SymbolHandler;