probe-web / @probe-web/client / index / UrlSourceProvider
Class: UrlSourceProvider
Defined in: sources.ts:47
Serve sources from a URL. prefix is the build-time directory that base corresponds to: { base: '/src/fw/', prefix: '/home/ci/fw/' } maps /home/ci/fw/src/main.rs to /src/fw/src/main.rs. Paths outside prefix are not served.
Implements
Constructors
Constructor
ts
new UrlSourceProvider(opts): UrlSourceProvider;Defined in: sources.ts:53
base: the URL the sources are served under. prefix: the build-time directory it corresponds to.
Parameters
| Parameter | Type |
|---|---|
opts | { base: string; prefix: string; } |
opts.base | string |
opts.prefix | string |
Returns
UrlSourceProvider
Methods
resolve()
ts
resolve(path): Promise<string | null>;Defined in: sources.ts:59
The path relative to prefix, or null if path is outside it.
Parameters
| Parameter | Type |
|---|---|
path | string |
Returns
Promise<string | null>
Implementation of
read()
ts
read(path): Promise<string | null>;Defined in: sources.ts:65
Fetch the file (once; results are cached). null if it is outside prefix or the fetch fails.
Parameters
| Parameter | Type |
|---|---|
path | string |
Returns
Promise<string | null>