63 lines
2.8 KiB
React
63 lines
2.8 KiB
React
/* Metro module 322; source: unknown; dependencies: [57, 90] */
|
|
function _fun4879(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#4879, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:363:6, offset: 0x00ccfd57, size: 81 bytes, params: 8, frame: 18
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_2 = importDefault(57) /* metro dependency 57 */;
|
|
exports.getImageSourcesFromImageProps = getImageSourcesFromImageProps;
|
|
}
|
|
|
|
function getImageSourcesFromImageProps({source, crossOrigin, referrerPolicy, src, srcSet, width, height}) { // fn#4880, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:363:138, offset: 0x00ccfda8, size: 392 bytes, params: 2, frame: 24
|
|
var r0;
|
|
var items2;
|
|
let value = importDefault(90) /* metro dependency 90 */;
|
|
value = value(source);
|
|
const object2 = {};
|
|
if (crossOrigin === 'use-credentials') {
|
|
object2['Access-Control-Allow-Credentials'] = 'true';
|
|
}
|
|
if (referrerPolicy != null) {
|
|
object2['Referrer-Policy'] = referrerPolicy;
|
|
}
|
|
if (srcSet != null) {
|
|
items2 = [];
|
|
value = srcSet.split(', ');
|
|
var env0_4 = true;
|
|
value.forEach(_fun4881);
|
|
if (env0_4 && src != null) {
|
|
items2.push({headers: object2, scale: 1, uri: src, width: width, height: height});
|
|
}
|
|
if (items2.length !== 0) {
|
|
r0 = items2;
|
|
} else {
|
|
global.console.warn('The provided value for srcSet is not valid.');
|
|
r0 = items2;
|
|
}
|
|
} else {
|
|
r0 = src != null ? [{uri: src, headers: object2, width: width,
|
|
height: height}] : value == null ? value : value.uri && global.Object.keys(object2).length > 0 ? [global.Object.assign({},
|
|
|
|
value, {headers: object2})] : value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function _fun4881(a0) { // fn#4881, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:363:443, offset: 0x00ccff30, size: 226 bytes, params: 2, frame: 19
|
|
var r1;
|
|
let value = a0.split(' ');
|
|
value = env1_2(value, 2);
|
|
const property = value[0];
|
|
const property2 = value[1];
|
|
const r6 = property2 === undefined ? '1x' : property2;
|
|
value = r6.endsWith('x');
|
|
if (value) {
|
|
value = global.parseInt(r6.split('x')[0], 10);
|
|
if (!global.isNaN(value)) {
|
|
r1 = value !== 1 && env0_4;
|
|
env0_3.push({headers: env0_2, scale: value, uri: property, width: width, height: height});
|
|
}
|
|
} else {
|
|
global.console.warn('The provided format for scale is not supported yet. Please use scales like 1x, 2x, etc.');
|
|
}
|
|
}
|
|
|