Skip to content

Commit fe36fb2

Browse files
committed
changeset and test
1 parent a4f4708 commit fe36fb2

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

.changeset/fifty-wombats-help.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ export type Ref<KeyT extends KeyTypeConstraints = string> = {
190190
};
191191

192192
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');
193+
return maybeRef && typeof maybeRef === 'object' && '$ref' in maybeRef;
194194
}
195195

196196
export function assertIsRef<KeyT extends KeyTypeConstraints = string>(

0 commit comments

Comments
 (0)