Skip to content

Commit

Permalink
Use globalThis
Browse files Browse the repository at this point in the history
  • Loading branch information
ankrgyl committed Oct 15, 2023
1 parent ba9f72f commit a411c1a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions js/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ declare global {
var __inherited_braintrust_state: any;
}
export function currentSpan() {
if (__inherited_braintrust_state) {
return __inherited_braintrust_state.currentSpan.getStore();
if (globalThis.__inherited_braintrust_state) {
return globalThis.__inherited_braintrust_state.currentSpan.getStore();
} else {
return new NoopSpan();
}
Expand Down

0 comments on commit a411c1a

Please sign in to comment.