@substrate-system/mergeparty
Version:
Automerge + Partykit
8 lines (7 loc) • 1.42 kB
Source Map (JSON)
{
"version": 3,
"sources": ["../../src/server/polyfill.js"],
"sourcesContent": ["// Polyfill for performance.now in PartyKit environment\n// Try multiple approaches to ensure the polyfill reaches the bundled code\n\n// Approach 1: globalThis\nif (typeof globalThis.performance === 'undefined') {\n globalThis.performance = { now: () => Date.now() }\n}\n\n// Approach 2: global (Node.js style)\nif (typeof global !== 'undefined' && typeof global.performance === 'undefined') {\n global.performance = { now: () => Date.now() }\n}\n\n// Approach 3: Direct property assignment\ntry {\n Object.defineProperty(globalThis, 'performance', {\n value: { now: () => Date.now() },\n writable: true,\n configurable: true\n })\n} catch (_e) {\n // Ignore if already defined\n}\n\n// Approach 4: Try to override any existing partial performance object\nif (globalThis.performance && !globalThis.performance.now) {\n globalThis.performance.now = () => Date.now()\n}\n"],
"mappings": "4FAII,OAAO,WAAW,YAAgB,MAClC,WAAW,YAAc,CAAE,IAAKA,EAAA,IAAM,KAAK,IAAI,EAAf,MAAiB,GAIjD,OAAO,OAAW,KAAe,OAAO,OAAO,YAAgB,MAC/D,OAAO,YAAc,CAAE,IAAKA,EAAA,IAAM,KAAK,IAAI,EAAf,MAAiB,GAIjD,GAAI,CACA,OAAO,eAAe,WAAY,cAAe,CAC7C,MAAO,CAAE,IAAKA,EAAA,IAAM,KAAK,IAAI,EAAf,MAAiB,EAC/B,SAAU,GACV,aAAc,EAClB,CAAC,CACL,MAAa,CAEb,CAGI,WAAW,aAAe,CAAC,WAAW,YAAY,MAClD,WAAW,YAAY,IAAM,IAAM,KAAK,IAAI",
"names": ["__name"]
}