@hpcc-js/observablehq-compiler 1.2.4 → 1.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +6 -12
- package/dist/index.esm.js.map +1 -1
- package/dist/index.esm.min.js +1 -1
- package/dist/index.esm.min.js.map +1 -1
- package/dist/index.js +6 -12
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +2 -2
- package/dist/index.min.js.map +1 -1
- package/package.json +2 -2
- package/src/__package__.ts +2 -2
- package/src/util.ts +11 -17
- package/types/__package__.d.ts +2 -2
- package/types/util.d.ts +1 -1
- package/types/util.d.ts.map +1 -1
- package/types-3.4/__package__.d.ts +2 -2
- package/types-3.4/util.d.ts +1 -1
package/dist/index.js
CHANGED
|
@@ -6755,26 +6755,20 @@
|
|
|
6755
6755
|
})
|
|
6756
6756
|
};
|
|
6757
6757
|
}
|
|
6758
|
-
function fetchEx(url, proxyPrefix = "https://
|
|
6759
|
-
|
|
6760
|
-
|
|
6758
|
+
function fetchEx(url, proxyPrefix = "https://api.codetabs.com/v1/proxy/?quest=", proxyPostfix = "") {
|
|
6759
|
+
const matches = url.match(/^(?:https?:\/\/)?(?:[^@\n]+@)?(?:www\.)?([^:\/\n?]+)/img);
|
|
6760
|
+
return fetch(url, { headers: { origin: matches[0], referer: url } }).then(response => {
|
|
6761
6761
|
if (response.ok)
|
|
6762
6762
|
return response;
|
|
6763
6763
|
throw new Error("CORS?");
|
|
6764
6764
|
}).catch(e => {
|
|
6765
|
-
const matches = url.match(/^(?:https?:\/\/)?(?:[^@\n]+@)?(?:www\.)?([^:\/\n?]+)/img);
|
|
6766
6765
|
url = `${proxyPrefix}${url}${proxyPostfix}`;
|
|
6767
|
-
return fetch(url, {
|
|
6768
|
-
headers: {
|
|
6769
|
-
origin: matches[0],
|
|
6770
|
-
referer: url
|
|
6771
|
-
}
|
|
6772
|
-
});
|
|
6766
|
+
return fetch(url, { headers: { origin: matches[0], referer: url } });
|
|
6773
6767
|
});
|
|
6774
6768
|
}
|
|
6775
|
-
function download(impUrl) {
|
|
6769
|
+
function download(impUrl, proxyPrefix, proxyPostfix) {
|
|
6776
6770
|
const isShared = impUrl.indexOf("https://observablehq.com/d") === 0;
|
|
6777
|
-
return fetchEx(impUrl.replace(`https://observablehq.com/${isShared ? "d/" : ""}`, "https://api.observablehq.com/document/"))
|
|
6771
|
+
return fetchEx(impUrl.replace(`https://observablehq.com/${isShared ? "d/" : ""}`, "https://api.observablehq.com/document/"), proxyPrefix, proxyPostfix)
|
|
6778
6772
|
.then(r => r.json());
|
|
6779
6773
|
}
|
|
6780
6774
|
|