ts-anything-to-string
v1.0.1
Published
A simple and useful function to transform anything in a full readable string
Downloads
1,026
Readme
Typescript Anything to String
A simple and useful function to transform anything in a full readable string.
Installation
npm install ts-anything-to-string --saveHow to use
import { safeToString } from 'ts-anything-to-string';
const error = new Error('error');
console.log(safeToString(error)); //'Error: error'
const object = { id: 'test' };
console.log(safeToString(object)); //'{"id":"teste"}'