Skip to content

Commit e46007e

Browse files
committed
fix(cloudflare): Account for static fields in wrapper type
1 parent fcdc4d7 commit e46007e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

packages/cloudflare/src/durableobject.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,11 @@ function wrapMethodWithSentry<T extends (...args: any[]) => any>(
133133
* );
134134
* ```
135135
*/
136-
export function instrumentDurableObjectWithSentry<E, T extends DurableObject<E>>(
137-
optionsCallback: (env: E) => CloudflareOptions,
138-
DurableObjectClass: new (state: DurableObjectState, env: E) => T,
139-
): new (state: DurableObjectState, env: E) => T {
136+
export function instrumentDurableObjectWithSentry<
137+
E,
138+
T extends DurableObject<E>,
139+
C extends new (state: DurableObjectState, env: E) => T,
140+
>(optionsCallback: (env: E) => CloudflareOptions, DurableObjectClass: C): C {
140141
return new Proxy(DurableObjectClass, {
141142
construct(target, [context, env]) {
142143
setAsyncLocalStorageAsyncContextStrategy();

0 commit comments

Comments
 (0)