@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.esm.js
CHANGED
|
@@ -6749,26 +6749,20 @@ function omd2notebook(omd) {
|
|
|
6749
6749
|
})
|
|
6750
6750
|
};
|
|
6751
6751
|
}
|
|
6752
|
-
function fetchEx(url, proxyPrefix = "https://
|
|
6753
|
-
|
|
6754
|
-
|
|
6752
|
+
function fetchEx(url, proxyPrefix = "https://api.codetabs.com/v1/proxy/?quest=", proxyPostfix = "") {
|
|
6753
|
+
const matches = url.match(/^(?:https?:\/\/)?(?:[^@\n]+@)?(?:www\.)?([^:\/\n?]+)/img);
|
|
6754
|
+
return fetch(url, { headers: { origin: matches[0], referer: url } }).then(response => {
|
|
6755
6755
|
if (response.ok)
|
|
6756
6756
|
return response;
|
|
6757
6757
|
throw new Error("CORS?");
|
|
6758
6758
|
}).catch(e => {
|
|
6759
|
-
const matches = url.match(/^(?:https?:\/\/)?(?:[^@\n]+@)?(?:www\.)?([^:\/\n?]+)/img);
|
|
6760
6759
|
url = `${proxyPrefix}${url}${proxyPostfix}`;
|
|
6761
|
-
return fetch(url, {
|
|
6762
|
-
headers: {
|
|
6763
|
-
origin: matches[0],
|
|
6764
|
-
referer: url
|
|
6765
|
-
}
|
|
6766
|
-
});
|
|
6760
|
+
return fetch(url, { headers: { origin: matches[0], referer: url } });
|
|
6767
6761
|
});
|
|
6768
6762
|
}
|
|
6769
|
-
function download(impUrl) {
|
|
6763
|
+
function download(impUrl, proxyPrefix, proxyPostfix) {
|
|
6770
6764
|
const isShared = impUrl.indexOf("https://observablehq.com/d") === 0;
|
|
6771
|
-
return fetchEx(impUrl.replace(`https://observablehq.com/${isShared ? "d/" : ""}`, "https://api.observablehq.com/document/"))
|
|
6765
|
+
return fetchEx(impUrl.replace(`https://observablehq.com/${isShared ? "d/" : ""}`, "https://api.observablehq.com/document/"), proxyPrefix, proxyPostfix)
|
|
6772
6766
|
.then(r => r.json());
|
|
6773
6767
|
}
|
|
6774
6768
|
|