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.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 newUrl = `${config?.pinataGateway}/files/${options.cid}`;
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)