Skip to content
This repository has been archived by the owner on Sep 14, 2023. It is now read-only.

Commit

Permalink
feat: warn on multiple instances of capi (#979)
Browse files Browse the repository at this point in the history
  • Loading branch information
tjjfvi authored May 8, 2023
1 parent 437e0ce commit dce469e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions mod.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
const CAPI_MARKER = Symbol.for("paritytech/capi")
if (CAPI_MARKER in globalThis) {
console.warn("Multiple instances of Capi loaded -- this will lead to unexpected behavior!")
}
;(globalThis as any)[CAPI_MARKER] = true

export * as $ from "./deps/scale.ts"
export { BitSequence } from "./deps/scale.ts"
export * from "./server/client/mod.ts"
Expand Down

0 comments on commit dce469e

Please sign in to comment.