(name: "btoa" | "atob")
| 2 | const textDecoder = typeof TextDecoder !== "undefined" ? new TextDecoder() : undefined; |
| 3 | |
| 4 | function hasWindowFunction(name: "btoa" | "atob"): boolean { |
| 5 | if (typeof window === "undefined") return false; |
| 6 | const fn = (window as unknown as Record<string, unknown>)[name]; |
| 7 | return typeof fn === "function"; |
| 8 | } |
| 9 | |
| 10 | function getGlobalBuffer(): undefined | { from(input: string, encoding: string): { toString(encoding: string): string } } { |
| 11 | // `Buffer` is a Node global (present in Obsidian's Electron renderer and in |
no outgoing calls
no test coverage detected