跳到主要内容

rewriteOpfsProxyWorkerUrl()

function rewriteOpfsProxyWorkerUrl(scriptUrl, opfsProxyPath): string | URL;

Defined in: packages/rxdb-adapter-sqlite-core/src/sqlite-oo1-load.utils.ts:115

把 sqlite3 内置的 OPFS proxy worker URL 重写到用户提供的路径。

用于 bundler 把 worker 脚本输出到非默认位置的场景;非 proxy URL 原样返回。

Parameters

ParameterTypeDescription
scriptUrlstring | URL原始 worker URL(来自 sqlite3 内部 new Worker(...)
opfsProxyPathstring用户指定的替代路径

Returns

string | URL

替换后的 URL(若不匹配则返回原值)