MCPcopy
hub / github.com/imgly/background-removal-js / validateConfig

Function validateConfig

packages/web/src/schema.ts:59–76  ·  view source on GitHub ↗
(configuration?: Config)

Source from the content-addressed store, hash-verified

57type Config = z.infer<typeof ConfigSchema>;
58
59function validateConfig(configuration?: Config): Config {
60 const config = ConfigSchema.parse(configuration ?? {});
61 if (config.debug) console.log('Config:', config);
62 if (config.debug && !config.progress) {
63 config.progress =
64 config.progress ??
65 ((key, current, total) => {
66 console.debug(`Downloading ${key}: ${current} of ${total}`);
67 });
68
69 if (!crossOriginIsolated) {
70 console.debug(
71 'Cross-Origin-Isolated is not enabled. Performance will be degraded. Please see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer.'
72 );
73 }
74 }
75 return config;
76}

Callers 3

preloadFunction · 0.90
applySegmentationMaskFunction · 0.90
initInferenceFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected