pinata 1.3.0 → 1.4.0
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.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1329,7 +1329,13 @@ var createSignedURL = async (config, options, imgOpts) => {
|
|
|
1329
1329
|
if (!config) {
|
|
1330
1330
|
throw new ValidationError("Pinata configuration is missing");
|
|
1331
1331
|
}
|
|
1332
|
-
let
|
|
1332
|
+
let baseUrl;
|
|
1333
|
+
if (options?.gateway) {
|
|
1334
|
+
baseUrl = options.gateway.startsWith("https://") ? options.gateway : `https://${options.gateway}`;
|
|
1335
|
+
} else {
|
|
1336
|
+
baseUrl = config.pinataGateway;
|
|
1337
|
+
}
|
|
1338
|
+
let newUrl = `${baseUrl}/files/${options.cid}`;
|
|
1333
1339
|
const params = new URLSearchParams();
|
|
1334
1340
|
if (imgOpts) {
|
|
1335
1341
|
if (imgOpts.width)
|