项目原始demo,不改动
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

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. };