Skip to content

Commit

Permalink
fix: ensure proper symbols stringification in early implementations
Browse files Browse the repository at this point in the history
  • Loading branch information
medikoo committed May 31, 2017
1 parent d6fa82d commit ce51900
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions object/validate-stringifiable.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
'use strict';

var isCallable = require('./is-callable');

module.exports = function (stringifiable) {
try {
if (stringifiable && isCallable(stringifiable.toString)) return stringifiable.toString();
return String(stringifiable);
} catch (e) {
throw new TypeError("Passed argument cannot be stringifed");
Expand Down

0 comments on commit ce51900

Please sign in to comment.