( config: PartytownInternalConfig, value: string )
| 227 | } |
| 228 | |
| 229 | export 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 | |
| 240 | export function serializeConfig(config: PartytownConfig) { |
| 241 | return JSON.stringify(config, (key, value) => { |
no test coverage detected
searching dependent graphs…