@utx/result
Version:
A typescript implementation of Rust's Result and Option objects.
21 lines (18 loc) • 363 B
JavaScript
/**
* @utx/result v3.4.0
* Author: Gabe M <hey@gabe.mx>
* LICENSE: ISC
*
* https://github.com/fromgmworks/typescript-result
*/
function toString(val) {
var value = String(val);
if (value === '[object Object]') {
try {
value = JSON.stringify(val);
}
catch (_a) { }
}
return value;
}
export { toString };