(path, allowRemoteRequests)
| 161 | export const isUrl = (path) => /^https?:\/\//.test(path); |
| 162 | |
| 163 | export 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 |
| 172 | export const checkTransition = (transition) => assert(transition == null || typeof transition === 'object', 'Transition must be an object'); |
no test coverage detected