MCPcopy
hub / github.com/QwikDev/partytown / testIfMustLoadScriptOnMainThread

Function testIfMustLoadScriptOnMainThread

src/lib/utils.ts:229–238  ·  view source on GitHub ↗
(
  config: PartytownInternalConfig,
  value: string
)

Source from the content-addressed store, hash-verified

227}
228
229export function testIfMustLoadScriptOnMainThread(
230 config: PartytownInternalConfig,
231 value: string
232): boolean {
233 return (
234 config.loadScriptsOnMainThread
235 ?.map(([type, value]) => new RegExp(type === 'string' ? escapeRegExp(value) : value))
236 .some((regexp) => regexp.test(value)) ?? false
237 );
238}
239
240export function serializeConfig(config: PartytownConfig) {
241 return JSON.stringify(config, (key, value) => {

Callers 2

insertBeforeMethod · 0.90
setFunction · 0.90

Calls 1

escapeRegExpFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…