PageSourceSearch

https://www.lahsa.org/js/fetchWrapper.js?v=0.0.4

js lahsa.org collected 2026-09-24 09:02:32 UTC 1,135 bytes, 45 lines download raw bytes

1const fetchWrapper = {
2    get,
3    post,
4    postFormData
5}
6
7
8function get(url, responseType = 'json') {
9    return fetch(url, { method: 'GET' })
10        .then(response => handleResponse(response, responseType));
11}
12
13
14function post(url, body, responseType = 'json') {
15    return fetch(url, {
16        method: 'POST',
17        headers: { 'Content-Type': 'application/json' },
18        body: JSON.stringify(body)
19    })
20        .then(response => handleResponse(response, responseType));
21}
22
23function postFormData(url, body, responseType = 'json') {
24    return fetch(url, {
25        method: 'POST',
26        body: body
27    })
28        .then(response => handleResponse(response, responseType));
29}
30
31function handleResponse(response, responseType) {
32    if (!response.ok) {
33        return response.text().then(text => {
34            throw new Error(text || response.statusText);
35        });
36    }
37
38    if (responseType === 'text') {
39        return response.text(); // HTML support
40    }
41
42    return response.text().then(text => {
43        return text ? JSON.parse(text) : null; // JSON default
44    });
45}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.