MCPcopy
hub / github.com/sindresorhus/got / prefixUrl

Method prefixUrl

source/core/options.ts:1835–1839  ·  view source on GitHub ↗

When specified, `prefixUrl` will be prepended to relative string `url` input. The prefix can be any valid URL, either relative or absolute. A trailing slash `/` is optional - one will be added automatically. __Note__: Absolute string URLs and URL instances bypass `prefixUrl` by default. Other in

()

Source from the content-addressed store, hash-verified

1833 ```
1834 */
1835 get prefixUrl(): string | URL {
1836 // We always return `string` here.
1837 // It has to be `string | URL`, otherwise TypeScript will error because the getter and the setter have incompatible types.
1838 return this.#internals.prefixUrl;
1839 }
1840
1841 set prefixUrl(value: string | URL) {
1842 assertAny('prefixUrl', [is.string, is.urlInstance], value);

Callers

nothing calls this directly

Calls 1

assertAnyFunction · 0.85

Tested by

no test coverage detected