MCPcopy
hub / github.com/mifi/editly / assertFileValid

Function assertFileValid

util.js:163–169  ·  view source on GitHub ↗
(path, allowRemoteRequests)

Source from the content-addressed store, hash-verified

161export const isUrl = (path) => /^https?:\/\//.test(path);
162
163export const assertFileValid = async (path, allowRemoteRequests) => {
164 if (isUrl(path)) {
165 assert(allowRemoteRequests, 'Remote requests are not allowed');
166 return;
167 }
168 assert(await fsExtra.pathExists(path), `File does not exist ${path}`);
169};
170
171// See #16
172export const checkTransition = (transition) => assert(transition == null || typeof transition === 'object', 'Transition must be an object');

Callers 3

EditlyFunction · 0.90
validateArbitraryAudioFunction · 0.90
handleLayerFunction · 0.90

Calls 1

isUrlFunction · 0.85

Tested by

no test coverage detected