instanceof.js 595 B

123456789101112131415161718192021
  1. "use strict";
  2. exports.__esModule = true;
  3. var _hasInstance = require("../core-js/symbol/has-instance");
  4. var _hasInstance2 = _interopRequireDefault(_hasInstance);
  5. var _symbol = require("../core-js/symbol");
  6. var _symbol2 = _interopRequireDefault(_symbol);
  7. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  8. exports.default = function (left, right) {
  9. if (right != null && typeof _symbol2.default !== "undefined" && right[_hasInstance2.default]) {
  10. return right[_hasInstance2.default](left);
  11. } else {
  12. return left instanceof right;
  13. }
  14. };