* Factory for a loader constructor that provides methods for requesting * files from either the network or disk, and for sanitizing request URIs. * @param {function} fetch - The Fetch API for HTTP network requests. * If null or undefined, HTTP loading will be disabled. * @param {object} fs - T
(fetch, fs)
| 108926 | * param {object} [options] - Optional default loading options to use. |
| 108927 | * return {object} - A new loader instance. |
| 108928 | */ function loaderFactory(fetch, fs) { |
| 108929 | return (options)=>({ |
| 108930 | options: options || {}, |
| 108931 | sanitize: sanitize, |
| 108932 | load: load, |
| 108933 | fileAccess: !!fs, |
| 108934 | file: fileLoader(fs), |
| 108935 | http: httpLoader(fetch) |
| 108936 | }); |
| 108937 | } |
| 108938 | /** |
| 108939 | * Load an external resource, typically either from the web or from the local |
| 108940 | * filesystem. This function uses {@link sanitize} to first sanitize the uri, |
no test coverage detected