We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a4f4708 commit fe36fb2Copy full SHA for fe36fb2
2 files changed
.changeset/fifty-wombats-help.md
@@ -0,0 +1,5 @@
1
+---
2
+'@graphql-tools/mock': patch
3
4
+
5
+Safer use of Object.prototype.hasOwnProperty #3069
packages/mock/src/types.ts
@@ -190,7 +190,7 @@ export type Ref<KeyT extends KeyTypeConstraints = string> = {
190
};
191
192
export function isRef<KeyT extends KeyTypeConstraints = string>(maybeRef: unknown): maybeRef is Ref<KeyT> {
193
- return maybeRef && typeof maybeRef === 'object' && Object.prototype.hasOwnProperty.call(maybeRef, '$ref');
+ return maybeRef && typeof maybeRef === 'object' && '$ref' in maybeRef;
194
}
195
196
export function assertIsRef<KeyT extends KeyTypeConstraints = string>(
0 commit comments