(audio, allowRemoteRequests)
| 19 | const loadedFonts = []; |
| 20 | |
| 21 | async function validateArbitraryAudio(audio, allowRemoteRequests) { |
| 22 | assert(audio === undefined || Array.isArray(audio)); |
| 23 | |
| 24 | if (audio) { |
| 25 | // eslint-disable-next-line no-restricted-syntax |
| 26 | for (const { path, cutFrom, cutTo, start } of audio) { |
| 27 | await assertFileValid(path, allowRemoteRequests); |
| 28 | |
| 29 | if (cutFrom != null && cutTo != null) assert(cutTo > cutFrom); |
| 30 | if (cutFrom != null) assert(cutFrom >= 0); |
| 31 | if (cutTo != null) assert(cutTo >= 0); |
| 32 | assert(start == null || start >= 0, `Invalid "start" ${start}`); |
| 33 | } |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | export default async function parseConfig({ defaults: defaultsIn = {}, clips, arbitraryAudio: arbitraryAudioIn, backgroundAudioPath, backgroundAudioVolume, loopAudio, allowRemoteRequests, ffprobePath }) { |
| 38 | const defaults = { |
no test coverage detected