swc/packages/swc-helpers/src/_instanceof.mjs

8 lines
247 B
JavaScript
Raw Normal View History

2021-12-05 09:46:09 +03:00
export default function _instanceof(left, right) {
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
return !!right[Symbol.hasInstance](left);
} else {
return left instanceof right;
}
}