(configuration?: Config)
| 57 | type Config = z.infer<typeof ConfigSchema>; |
| 58 | |
| 59 | function 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 | } |
no outgoing calls
no test coverage detected