mirror of
https://github.com/cp6/my-idlers.git
synced 2024-11-16 23:42:32 +01:00
fd22b0bf58
V2 (Laravel re-make)
13 lines
266 B
JavaScript
Vendored
13 lines
266 B
JavaScript
Vendored
"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>";
|
|
}
|
|
};
|