@lighthouse/common 6.2.0-canary.20 → 6.2.0-canary.21
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.
|
@@ -15,6 +15,7 @@ function buildFetchUrl(url, options) {
|
|
|
15
15
|
quality,
|
|
16
16
|
shouldUseCloudfront
|
|
17
17
|
} = options;
|
|
18
|
+
console.debug(JSON.stringify(options, null, 2));
|
|
18
19
|
if (shouldUseCloudfront) {
|
|
19
20
|
const transformations = [];
|
|
20
21
|
if (width) transformations.push(`width=${width.toString()}`);
|
|
@@ -8,6 +8,7 @@ export function buildFetchUrl(url, options) {
|
|
|
8
8
|
width = options.width,
|
|
9
9
|
quality = options.quality,
|
|
10
10
|
shouldUseCloudfront = options.shouldUseCloudfront;
|
|
11
|
+
console.debug(JSON.stringify(options, null, 2));
|
|
11
12
|
if (shouldUseCloudfront) {
|
|
12
13
|
var _transformations = [];
|
|
13
14
|
if (width) _transformations.push("width=".concat(width.toString()));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["buildFetchUrl","url","options","awsS3BaseUrl","_options$cloudfrontBa","cloudfrontBaseUrl","cloudinaryBaseUrl","fit","height","width","quality","shouldUseCloudfront","transformations","push","concat","toString","transformationsString","join","fetchUrl"],"sources":["../../../src/helpers/build-fetch-url/index.js"],"sourcesContent":["export function buildFetchUrl(url, options) {\n const {\n awsS3BaseUrl,\n cloudfrontBaseUrl = '',\n cloudinaryBaseUrl,\n fit,\n height,\n width,\n quality,\n shouldUseCloudfront,\n } = options\n\n if (shouldUseCloudfront) {\n const transformations = []\n\n if (width) transformations.push(`width=${width.toString()}`)\n if (height) transformations.push(`height=${height.toString()}`)\n if (quality) transformations.push(`quality=${quality.toString()}`)\n transformations.push(`fit=contain`)\n\n const transformationsString = transformations.join('&')\n\n const fetchUrl = `${cloudfrontBaseUrl}/${url}?${transformationsString}`\n return fetchUrl\n }\n\n const transformations = []\n let transformationsString = ''\n\n if (width) transformations.push(`w_${width.toString()}`)\n if (height) transformations.push(`h_${height.toString()}`)\n if (quality) transformations.push(`q_${quality.toString()}`)\n if (fit) transformations.push('c_fit')\n\n transformationsString = `${transformations.join(',')}/`\n\n const fetchUrl = `${cloudinaryBaseUrl}/${transformationsString}${awsS3BaseUrl}/${url}`\n\n return fetchUrl\n}\n"],"mappings":"AAAA,OAAO,SAASA,aAAaA,CAACC,GAAG,EAAEC,OAAO,EAAE;EAC1C,IACEC,YAAY,GAQVD,OAAO,CARTC,YAAY;IAAAC,qBAAA,GAQVF,OAAO,CAPTG,iBAAiB;IAAjBA,iBAAiB,GAAAD,qBAAA,cAAG,EAAE,GAAAA,qBAAA;IACtBE,iBAAiB,GAMfJ,OAAO,CANTI,iBAAiB;IACjBC,GAAG,GAKDL,OAAO,CALTK,GAAG;IACHC,MAAM,GAIJN,OAAO,CAJTM,MAAM;IACNC,KAAK,GAGHP,OAAO,CAHTO,KAAK;IACLC,OAAO,GAELR,OAAO,CAFTQ,OAAO;IACPC,mBAAmB,GACjBT,OAAO,CADTS,mBAAmB;
|
|
1
|
+
{"version":3,"file":"index.js","names":["buildFetchUrl","url","options","awsS3BaseUrl","_options$cloudfrontBa","cloudfrontBaseUrl","cloudinaryBaseUrl","fit","height","width","quality","shouldUseCloudfront","console","debug","JSON","stringify","transformations","push","concat","toString","transformationsString","join","fetchUrl"],"sources":["../../../src/helpers/build-fetch-url/index.js"],"sourcesContent":["export function buildFetchUrl(url, options) {\n const {\n awsS3BaseUrl,\n cloudfrontBaseUrl = '',\n cloudinaryBaseUrl,\n fit,\n height,\n width,\n quality,\n shouldUseCloudfront,\n } = options\n\n console.debug(JSON.stringify(options, null, 2))\n if (shouldUseCloudfront) {\n const transformations = []\n\n if (width) transformations.push(`width=${width.toString()}`)\n if (height) transformations.push(`height=${height.toString()}`)\n if (quality) transformations.push(`quality=${quality.toString()}`)\n transformations.push(`fit=contain`)\n\n const transformationsString = transformations.join('&')\n\n const fetchUrl = `${cloudfrontBaseUrl}/${url}?${transformationsString}`\n return fetchUrl\n }\n\n const transformations = []\n let transformationsString = ''\n\n if (width) transformations.push(`w_${width.toString()}`)\n if (height) transformations.push(`h_${height.toString()}`)\n if (quality) transformations.push(`q_${quality.toString()}`)\n if (fit) transformations.push('c_fit')\n\n transformationsString = `${transformations.join(',')}/`\n\n const fetchUrl = `${cloudinaryBaseUrl}/${transformationsString}${awsS3BaseUrl}/${url}`\n\n return fetchUrl\n}\n"],"mappings":"AAAA,OAAO,SAASA,aAAaA,CAACC,GAAG,EAAEC,OAAO,EAAE;EAC1C,IACEC,YAAY,GAQVD,OAAO,CARTC,YAAY;IAAAC,qBAAA,GAQVF,OAAO,CAPTG,iBAAiB;IAAjBA,iBAAiB,GAAAD,qBAAA,cAAG,EAAE,GAAAA,qBAAA;IACtBE,iBAAiB,GAMfJ,OAAO,CANTI,iBAAiB;IACjBC,GAAG,GAKDL,OAAO,CALTK,GAAG;IACHC,MAAM,GAIJN,OAAO,CAJTM,MAAM;IACNC,KAAK,GAGHP,OAAO,CAHTO,KAAK;IACLC,OAAO,GAELR,OAAO,CAFTQ,OAAO;IACPC,mBAAmB,GACjBT,OAAO,CADTS,mBAAmB;EAGrBC,OAAO,CAACC,KAAK,CAACC,IAAI,CAACC,SAAS,CAACb,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;EAC/C,IAAIS,mBAAmB,EAAE;IACvB,IAAMK,gBAAe,GAAG,EAAE;IAE1B,IAAIP,KAAK,EAAEO,gBAAe,CAACC,IAAI,UAAAC,MAAA,CAAUT,KAAK,CAACU,QAAQ,CAAC,CAAC,CAAE,CAAC;IAC5D,IAAIX,MAAM,EAAEQ,gBAAe,CAACC,IAAI,WAAAC,MAAA,CAAWV,MAAM,CAACW,QAAQ,CAAC,CAAC,CAAE,CAAC;IAC/D,IAAIT,OAAO,EAAEM,gBAAe,CAACC,IAAI,YAAAC,MAAA,CAAYR,OAAO,CAACS,QAAQ,CAAC,CAAC,CAAE,CAAC;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