12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- import { inspect } from './inspect.mjs';
- export const instanceOf =
-
-
- globalThis.process && globalThis.process.env.NODE_ENV === 'production'
- ? function instanceOf(value, constructor) {
- return value instanceof constructor;
- }
- : function instanceOf(value, constructor) {
- if (value instanceof constructor) {
- return true;
- }
- if (typeof value === 'object' && value !== null) {
- var _value$constructor;
-
- const className = constructor.prototype[Symbol.toStringTag];
- const valueClassName =
- Symbol.toStringTag in value
- ? value[Symbol.toStringTag]
- : (_value$constructor = value.constructor) === null ||
- _value$constructor === void 0
- ? void 0
- : _value$constructor.name;
- if (className === valueClassName) {
- const stringifiedValue = inspect(value);
- throw new Error(`Cannot use ${className} "${stringifiedValue}" from another module or realm.
- Ensure that there is only one instance of "graphql" in the node_modules
- directory. If different versions of "graphql" are the dependencies of other
- relied on modules, use "resolutions" to ensure only one version is installed.
- https:
- Duplicate "graphql" modules cannot be used at the same time since different
- versions may have different capabilities and behavior. The data from one
- version used in the function from another could produce confusing and
- spurious results.`);
- }
- }
- return false;
- };
|