mirror of
https://github.com/pdfme/pdfme.git
synced 2026-06-18 11:19:23 -04:00
16 lines
297 B
JavaScript
16 lines
297 B
JavaScript
function getUrl(input) {
|
|
if (typeof input === 'string') {
|
|
return input;
|
|
}
|
|
|
|
if (input instanceof URL) {
|
|
return input.href;
|
|
}
|
|
|
|
return input.url;
|
|
}
|
|
|
|
globalThis.fetch = async (input) => {
|
|
throw new Error(`Network access is disabled in this test environment: ${getUrl(input)}`);
|
|
};
|