@rg-dev/stdlib 1.0.12 → 1.0.13
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/lib/node-download.cjs
CHANGED
|
@@ -6077,12 +6077,12 @@ async function getFetch() {
|
|
|
6077
6077
|
}
|
|
6078
6078
|
return (await Promise.resolve().then(() => (init_src(), src_exports))).default;
|
|
6079
6079
|
}
|
|
6080
|
-
function downloadFile(url, destination) {
|
|
6080
|
+
function downloadFile(url, destination, headers) {
|
|
6081
6081
|
return new Promise(
|
|
6082
6082
|
async (resolve, reject) => {
|
|
6083
6083
|
try {
|
|
6084
6084
|
const fetcher = await getFetch();
|
|
6085
|
-
const response = await fetcher(url);
|
|
6085
|
+
const response = await fetcher(url, { headers: { ...headers || {} } });
|
|
6086
6086
|
if (!response.ok)
|
|
6087
6087
|
throw new Error("Error downloading file");
|
|
6088
6088
|
const dest = fs2.createWriteStream(destination);
|
package/lib/node-download.d.cts
CHANGED
package/lib/node-download.d.ts
CHANGED
package/lib/node-download.js
CHANGED
|
@@ -6078,12 +6078,12 @@ async function getFetch() {
|
|
|
6078
6078
|
}
|
|
6079
6079
|
return (await Promise.resolve().then(() => (init_src(), src_exports))).default;
|
|
6080
6080
|
}
|
|
6081
|
-
function downloadFile(url, destination) {
|
|
6081
|
+
function downloadFile(url, destination, headers) {
|
|
6082
6082
|
return new Promise(
|
|
6083
6083
|
async (resolve, reject) => {
|
|
6084
6084
|
try {
|
|
6085
6085
|
const fetcher = await getFetch();
|
|
6086
|
-
const response = await fetcher(url);
|
|
6086
|
+
const response = await fetcher(url, { headers: { ...headers || {} } });
|
|
6087
6087
|
if (!response.ok)
|
|
6088
6088
|
throw new Error("Error downloading file");
|
|
6089
6089
|
const dest = fs2.createWriteStream(destination);
|