Skip to content

Commit cab996e

Browse files
committed
Simplify unwrappers
1 parent eddeb8e commit cab996e

File tree

1 file changed

+6
-19
lines changed
  • packages/node/src/integrations/tracing/firebase/otel/patches

1 file changed

+6
-19
lines changed

packages/node/src/integrations/tracing/firebase/otel/patches/firestore.ts

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -123,26 +123,13 @@ function unwrapMethods(
123123
unwrap: typeof shimmerUnwrap,
124124
// eslint-disable-next-line @typescript-eslint/no-explicit-any
125125
): any {
126-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
127-
if (isWrapped(moduleExports.addDoc)) {
128-
unwrap(moduleExports, 'addDoc');
129-
}
130-
131-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
132-
if (isWrapped(moduleExports.getDocs)) {
133-
unwrap(moduleExports, 'getDocs');
134-
}
135-
136-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
137-
if (isWrapped(moduleExports.setDoc)) {
138-
unwrap(moduleExports, 'setDoc');
139-
}
140-
141-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
142-
if (isWrapped(moduleExports.deleteDoc)) {
143-
unwrap(moduleExports, 'deleteDoc');
126+
for (const method of ['addDoc', 'getDocs', 'setDoc', 'deleteDoc']) {
127+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
128+
if (isWrapped(moduleExports[method])) {
129+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
130+
unwrap(moduleExports, method);
131+
}
144132
}
145-
146133
return moduleExports;
147134
}
148135

0 commit comments

Comments
 (0)