Skip to content

Commit

Permalink
fix: improve error message readbility
Browse files Browse the repository at this point in the history
  • Loading branch information
medikoo committed Jun 1, 2018
1 parent 1727865 commit adc91b9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion safe-to-string.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ module.exports = function (value) {
if (value && isCallable(value.toString)) return value.toString();
return String(value);
} catch (e) {
return "<Non-coercible (to string) value>";
return "<Non-coercible to string value>";
}
};
2 changes: 1 addition & 1 deletion test/safe-to-string.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ module.exports = function (t, a) {
a(t({ toString: function () { return "miszka"; } }), "miszka");
// eslint-disable-next-line symbol-description
if (typeof Symbol === "function") a(t(Symbol()), "Symbol()");
a(t(Object.create(null)), "<Non-coercible (to string) value>");
a(t(Object.create(null)), "<Non-coercible to string value>");
};
2 changes: 1 addition & 1 deletion test/to-short-string-representation.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = function (t, a) {
a(t({ toString: function () { return "miszka"; } }), "miszka");
// eslint-disable-next-line symbol-description
if (typeof Symbol === "function") a(t(Symbol()), "Symbol()");
a(t(Object.create(null)), "<Non-coercible (to string) value>");
a(t(Object.create(null)), "<Non-coercible to string value>");
a(t(repeat.call("a", 300)), repeat.call("a", 99) + "…");
a(t("mar\ntoo\nfar"), "mar\\ntoo\\nfar");
};

0 comments on commit adc91b9

Please sign in to comment.