{"version":3,"file":"native-runtime.mjs","names":[],"sources":["../src/native-runtime.ts"],"sourcesContent":["import type { NativeAnonymizeBinding } from \"./native\";\nimport {\n  loadNativeAnonymizeBinding,\n  type LoadNativeBindingOptions,\n} from \"./native-node\";\n\n/**\n * Report whether the current JavaScript runtime is Bun.\n */\nexport const isBunRuntime = (): boolean =>\n  typeof (globalThis as { Bun?: unknown }).Bun !== \"undefined\";\n\n/**\n * Resolve the N-API binding used by both Node.js and Bun.\n */\nexport const loadDefaultNativeBinding = async (\n  options: LoadNativeBindingOptions = {},\n): Promise<NativeAnonymizeBinding> => loadNativeAnonymizeBinding(options);\n\nlet preloadPromise: Promise<void> | undefined;\n\n/**\n * Eagerly validate the native binding. Retained for compatibility with callers\n * that preloaded the former Bun-specific runtime fallback.\n */\nexport const preloadNativeBinding = async (): Promise<void> => {\n  preloadPromise ??= Promise.resolve().then(() => {\n    loadNativeAnonymizeBinding();\n    return undefined;\n  });\n  return preloadPromise;\n};\n"],"mappings":";;;;;AASA,MAAa,qBACX,OAAQ,WAAiC,QAAQ;;;;AAKnD,MAAa,2BAA2B,OACtC,UAAoC,CAAC,MACD,2BAA2B,OAAO;AAExE,IAAI;;;;;AAMJ,MAAa,uBAAuB,YAA2B;CAC7D,mBAAmB,QAAQ,QAAQ,CAAC,CAAC,WAAW;EAC9C,2BAA2B;CAE7B,CAAC;CACD,OAAO;AACT"}