safe-to-string.js 373 B

123456789101112
  1. "use strict";
  2. module.exports = function (t, a) {
  3. a(t(), "undefined");
  4. a(t(null), "null");
  5. a(t(10), "10");
  6. a(t("str"), "str");
  7. a(t({ toString: function () { return "miszka"; } }), "miszka");
  8. // eslint-disable-next-line symbol-description
  9. if (typeof Symbol === "function") a(t(Symbol()), "Symbol()");
  10. a(t(Object.create(null)), "<Non-coercible to string value>");
  11. };