1.0.1 • Published 11 months ago
ts-anything-to-string v1.0.1
Typescript Anything to String
A simple and useful function to transform anything in a full readable string.
Installation
npm install ts-anything-to-string --save
How 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"}'