first commit

This commit is contained in:
2025-08-02 16:30:27 +02:00
commit 23646bfcee
14851 changed files with 1750626 additions and 0 deletions

24
tests/cypress/util.ts Normal file
View File

@@ -0,0 +1,24 @@
export function syncFetch(
url: string,
init?: RequestInit & { body?: XMLHttpRequestBodyInit | Document },
) {
// Running under node.js
if (typeof window === 'undefined') {
return require('sync-fetch')(url, init);
}
const request = new XMLHttpRequest();
if (init?.headers) {
for (const [key, value] of Object.entries(init.headers)) {
request.setRequestHeader(key, value);
}
}
request.open(init?.method ?? 'GET', url, false);
request.send(init?.body ?? null);
return {
...request,
json: () => JSON.parse(request.responseText),
};
}