You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
266 B
12 lines
266 B
"use strict";
|
|
|
|
var isCallable = require("./object/is-callable");
|
|
|
|
module.exports = function (value) {
|
|
try {
|
|
if (value && isCallable(value.toString)) return value.toString();
|
|
return String(value);
|
|
} catch (e) {
|
|
return "<Non-coercible to string value>";
|
|
}
|
|
};
|
|
|