Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
/**
* Builds cache-busted frontend worker module URLs.
*/
export class WorkerUrlBuilder {
/**
* Resolves the parser worker module path relative to one entry module URL.
* @param {string} entryModuleUrl
* @param {string} cacheKey
* @returns {URL}
*/
static buildParserWorkerUrl(entryModuleUrl, cacheKey) {
const workerUrl = new URL(
'./workers/ecad-parser.worker.mjs',
entryModuleUrl
)
workerUrl.searchParams.set('v', String(cacheKey || '0'))
return workerUrl
}
/**
* Resolves the 3D scene worker module path relative to one entry module
* URL.
* @param {string} entryModuleUrl
* @param {string} cacheKey
* @returns {URL}
*/
static buildScene3dWorkerUrl(entryModuleUrl, cacheKey) {
const workerUrl = new URL(
'./workers/pcb-scene3d.worker.mjs',
entryModuleUrl
)
workerUrl.searchParams.set('v', String(cacheKey || '0'))
return workerUrl
}
/**
* Resolves the SPICE simulation worker module path relative to one entry
* module URL.
* @param {string} entryModuleUrl
* @param {string} cacheKey
* @returns {URL}
*/
static buildSpiceSimulationWorkerUrl(entryModuleUrl, cacheKey) {
const workerUrl = new URL(
'./workers/spice-simulation.worker.mjs',
entryModuleUrl
)
workerUrl.searchParams.set('v', String(cacheKey || '0'))
return workerUrl
}
}
5f635a4c0This file is pinned to the selected release. Download the original to open it in your design tool.