Skip to content

Commit 3c6f9c1

Browse files
author
Stefan-Gabriel Muscalu
committed
fix(mongo): bad isCursor check
1 parent 2085c5a commit 3c6f9c1

File tree

1 file changed

+3
-2
lines changed
  • packages/tracing/src/integrations/node

1 file changed

+3
-2
lines changed

packages/tracing/src/integrations/node/mongo.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,9 @@ interface MongoCursor {
9494

9595
function isCursor(value: unknown): value is MongoCursor {
9696
return (
97-
typeof value === 'function' &&
98-
value?.constructor?.name.indexOf('Cursor') !== -1 &&
97+
typeof value === 'object' &&
98+
!!value &&
99+
value.constructor.name.indexOf('Cursor') !== -1 &&
99100
'once' in value &&
100101
typeof (value as MongoCursor).once === 'function'
101102
);

0 commit comments

Comments
 (0)