457 lines
20 KiB
JavaScript
457 lines
20 KiB
JavaScript
/* Metro module 7463; source: unknown; dependencies: [65, 7376, 7378, 7425] */
|
|
import * as Module00065Module from './module-00065.js'; /* Metro dependency 65 */
|
|
import * as Module07425Module from './module-07425.js'; /* Metro dependency 7425 */
|
|
|
|
function _fun60182(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#60182, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7641:6, offset: 0x016fd9a6, size: 164 bytes, params: 8, frame: 23
|
|
let env0_0 = require;
|
|
const flattenIssue_601832 = flattenIssue_60183;
|
|
const closure2 = function(a0) {
|
|
return a0.map(_fun60185).join('.');
|
|
};
|
|
const formatIssueMessage_601862 = formatIssueMessage_60186;
|
|
const applyZodErrorsToEvent_601872 = applyZodErrorsToEvent_60187;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = Module07425Module;
|
|
value = value.defineIntegration(function() {
|
|
var r2;
|
|
r2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
var env0_0 = r2;
|
|
var env0_1 = r2.limit === undefined ? 10 : r2.limit;
|
|
return {name: 'ZodErrors', processEvent: _fun60189};
|
|
});
|
|
exports.applyZodErrorsToEvent = applyZodErrorsToEvent_601872;
|
|
exports.flattenIssue = flattenIssue_601832;
|
|
exports.flattenIssuePath = closure2;
|
|
exports.formatIssueMessage = formatIssueMessage_601862;
|
|
exports.zodErrorsIntegration = value;
|
|
function flattenIssuePath_60184(a0) { // fn#60184, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7641:325, offset: 0x016fda4a, size: 36 bytes, params: 2, frame: 11
|
|
return a0.map(function(a0) {
|
|
var value = a0;
|
|
return typeof value === 'number' ? '<array>' : value;
|
|
}).join('.');
|
|
}
|
|
|
|
function formatIssueMessage_60186(a0) { // fn#60186, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7641:430, offset: 0x00d77a57, size: 323 bytes, params: 2, frame: 21
|
|
var r3;
|
|
var r2;
|
|
var flattenIssuePath_60184Binding;
|
|
var path;
|
|
var value3;
|
|
var length;
|
|
var value4;
|
|
var add;
|
|
var error;
|
|
var Array;
|
|
var from;
|
|
var moduleValue;
|
|
var truncate;
|
|
var join;
|
|
var HermesInternal;
|
|
var concat;
|
|
var property;
|
|
var value5;
|
|
var value6;
|
|
var expected;
|
|
var value7;
|
|
const Set = global.Set;
|
|
let set = new Set();
|
|
let issues = a0.issues;
|
|
const iterator = issues[Symbol.iterator]();
|
|
const iterator2 = iterator.next;
|
|
let r7 = iterator;
|
|
let item2 = Reflect.apply(iterator2, r7, []);
|
|
let item = item2.value;
|
|
item2 = item2.done ? undefined : r7;
|
|
reducibleJoin2: while (true) {
|
|
if (item2 === undefined) {
|
|
Array = global.Array;
|
|
from = Array.from;
|
|
set = Reflect.apply(from, Array, [set]);
|
|
length = set.length;
|
|
if (length === 0) {
|
|
issues = a0.issues;
|
|
length = issues.length;
|
|
set = 'variable';
|
|
reducibleJoin22: while (true) {
|
|
if (length > 0) {
|
|
issues = a0.issues;
|
|
property = issues[0];
|
|
value5 = property !== undefined;
|
|
reducibleJoin18: while (true) {
|
|
if (value5) {
|
|
value6 = 'expected' in property;
|
|
r3 = value6;
|
|
break reducibleJoin18;
|
|
}
|
|
r3 = value5;
|
|
break reducibleJoin18;
|
|
}
|
|
reducibleJoin20: while (true) {
|
|
if (r3) {
|
|
expected = property.expected;
|
|
value7 = typeof expected === 'string';
|
|
r3 = value7;
|
|
break reducibleJoin20;
|
|
}
|
|
break reducibleJoin20;
|
|
}
|
|
if (r3) {
|
|
expected = property.expected;
|
|
r2 = expected;
|
|
break reducibleJoin22;
|
|
}
|
|
r2 = set;
|
|
break reducibleJoin22;
|
|
}
|
|
r2 = set;
|
|
break reducibleJoin22;
|
|
}
|
|
concat = global.HermesInternal.concat;
|
|
return 'Failed to validate ' + r2;
|
|
}
|
|
moduleValue = require(7378) /* metro dependency 7378 */;
|
|
truncate = moduleValue.truncate;
|
|
join = set.join;
|
|
set = Reflect.apply(join, set, [', ']);
|
|
set = Reflect.apply(truncate, moduleValue, [set, 100]);
|
|
HermesInternal = global.HermesInternal;
|
|
concat = HermesInternal.concat;
|
|
return 'Failed to validate keys: ' + set;
|
|
}
|
|
break reducibleJoin2;
|
|
}
|
|
reducibleLoop2: while (true) {
|
|
try {
|
|
flattenIssuePath_60184Binding = flattenIssuePath_60184;
|
|
} catch (error) {
|
|
try {
|
|
item2.return();
|
|
} catch {
|
|
}
|
|
throw error;
|
|
}
|
|
try {
|
|
path = item.path;
|
|
} catch (error) {
|
|
try {
|
|
item2.return();
|
|
} catch {
|
|
}
|
|
throw error;
|
|
}
|
|
try {
|
|
value3 = flattenIssuePath_60184Binding(path);
|
|
} catch (error) {
|
|
try {
|
|
item2.return();
|
|
} catch {
|
|
}
|
|
throw error;
|
|
}
|
|
try {
|
|
length = value3.length;
|
|
} catch (error) {
|
|
try {
|
|
item2.return();
|
|
} catch {
|
|
}
|
|
throw error;
|
|
}
|
|
try {
|
|
value4 = length > 0;
|
|
} catch (error) {
|
|
try {
|
|
item2.return();
|
|
} catch {
|
|
}
|
|
throw error;
|
|
}
|
|
reducibleJoin1: while (true) {
|
|
if (value4) {
|
|
try {
|
|
add = set.add;
|
|
} catch (error) {
|
|
try {
|
|
item2.return();
|
|
} catch {
|
|
}
|
|
throw error;
|
|
}
|
|
try {
|
|
Reflect.apply(add, set, [value3]);
|
|
} catch (error) {
|
|
try {
|
|
item2.return();
|
|
} catch {
|
|
}
|
|
throw error;
|
|
}
|
|
r7 = item2;
|
|
break reducibleJoin1;
|
|
}
|
|
r7 = item2;
|
|
break reducibleJoin1;
|
|
}
|
|
item2 = Reflect.apply(iterator2, r7, []);
|
|
item = item2.value;
|
|
item2 = item2.done ? undefined : r7;
|
|
if (item2 === undefined) {
|
|
break reducibleLoop2;
|
|
}
|
|
continue reducibleLoop2;
|
|
}
|
|
Array = global.Array;
|
|
set = Array.from(set);
|
|
length = set.length;
|
|
if (length === 0) {
|
|
issues = a0.issues;
|
|
length = issues.length;
|
|
set = 'variable';
|
|
reducibleJoin22: while (true) {
|
|
if (length > 0) {
|
|
issues = a0.issues;
|
|
property = issues[0];
|
|
value5 = property !== undefined;
|
|
reducibleJoin18: while (true) {
|
|
if (value5) {
|
|
value6 = 'expected' in property;
|
|
r3 = value6;
|
|
break reducibleJoin18;
|
|
}
|
|
r3 = value5;
|
|
break reducibleJoin18;
|
|
}
|
|
reducibleJoin20: while (true) {
|
|
if (r3) {
|
|
expected = property.expected;
|
|
value7 = typeof expected === 'string';
|
|
r3 = value7;
|
|
break reducibleJoin20;
|
|
}
|
|
break reducibleJoin20;
|
|
}
|
|
if (r3) {
|
|
expected = property.expected;
|
|
r2 = expected;
|
|
break reducibleJoin22;
|
|
}
|
|
r2 = set;
|
|
break reducibleJoin22;
|
|
}
|
|
r2 = set;
|
|
break reducibleJoin22;
|
|
}
|
|
return 'Failed to validate ' + r2;
|
|
}
|
|
moduleValue = require(7378) /* metro dependency 7378 */;
|
|
truncate = moduleValue.truncate;
|
|
set = set.join(', ');
|
|
set = Reflect.apply(truncate, moduleValue, [set, 100]);
|
|
HermesInternal = global.HermesInternal;
|
|
return 'Failed to validate keys: ' + set;
|
|
}
|
|
|
|
function applyZodErrorsToEvent_60187(a0) { // fn#60187, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7641:819, offset: 0x016fda6e, size: 800 bytes, params: 2, frame: 35
|
|
var r34;
|
|
var r35;
|
|
var r5;
|
|
var r9;
|
|
var values;
|
|
var originalException;
|
|
var isError2;
|
|
var name;
|
|
var Array;
|
|
var isArray;
|
|
var issues;
|
|
var value9;
|
|
var value10;
|
|
var attachments;
|
|
var isArray3;
|
|
var object;
|
|
var push;
|
|
var JSON;
|
|
var value11;
|
|
var Object;
|
|
var assign;
|
|
var Object2;
|
|
var assign2;
|
|
var Object3;
|
|
var assign3;
|
|
var exception2;
|
|
var property;
|
|
var formatIssueMessage_60186Binding;
|
|
var value12;
|
|
var value13;
|
|
var items2;
|
|
var concat;
|
|
var binding;
|
|
var exception3;
|
|
var value14;
|
|
var Object4;
|
|
var assign4;
|
|
var extra;
|
|
var error;
|
|
var Object5;
|
|
var assign5;
|
|
var Error;
|
|
var message;
|
|
var stack;
|
|
let value = undefined;
|
|
const r3 = arguments.length > 1 && value !== arguments[1] && arguments[1];
|
|
const r32 = arguments.length > 2 ? arguments[2] : value;
|
|
const r33 = arguments.length > 3 ? arguments[3] : value;
|
|
let exception = r32.exception;
|
|
if (exception) {
|
|
exception = r32.exception;
|
|
values = exception.values;
|
|
if (values) {
|
|
if (r33) {
|
|
originalException = r33.originalException;
|
|
if (originalException) {
|
|
originalException = r33.originalException;
|
|
isError2 = (require(7376) /* metro dependency 7376 */).isError(originalException);
|
|
if (isError2) {
|
|
name = originalException.name;
|
|
r34 = name === 'ZodError';
|
|
} else {
|
|
r34 = isError2;
|
|
}
|
|
if (r34) {
|
|
Array = global.Array;
|
|
r35 = Array.isArray(originalException.issues);
|
|
} else {
|
|
r35 = r34;
|
|
}
|
|
if (r35) {
|
|
originalException = r33.originalException;
|
|
issues = originalException.issues;
|
|
if (issues.length !== 0) {
|
|
try {
|
|
originalException = r33.originalException;
|
|
issues = originalException.issues;
|
|
if (r3) {
|
|
r5 = issues;
|
|
} else {
|
|
value9 = issues.slice(0, a0);
|
|
r5 = value9;
|
|
}
|
|
value10 = r5.map(flattenIssue_60183);
|
|
if (r3) {
|
|
Array = global.Array;
|
|
isArray = Array.isArray;
|
|
attachments = r33.attachments;
|
|
isArray3 = Reflect.apply(isArray, Array, [attachments]);
|
|
if (!isArray3) {
|
|
r33.attachments = [];
|
|
}
|
|
attachments = r33.attachments;
|
|
push = attachments.push;
|
|
JSON = global.JSON;
|
|
value11 = JSON.stringify({issues: value10});
|
|
Reflect.apply(push, attachments, [{filename: 'zod_issues.json', data: value11}]);
|
|
}
|
|
Object = global.Object;
|
|
assign = Object.assign;
|
|
object = {};
|
|
Object2 = global.Object;
|
|
assign2 = Object2.assign;
|
|
exception = r32.exception;
|
|
Object3 = global.Object;
|
|
assign3 = Object3.assign;
|
|
exception2 = r32.exception;
|
|
values = exception2.values;
|
|
property = values[0];
|
|
formatIssueMessage_60186Binding = formatIssueMessage_60186;
|
|
originalException = r33.originalException;
|
|
value12 = formatIssueMessage_60186Binding(originalException);
|
|
value13 = Reflect.apply(assign3, Object3, [{}, property, {value: value12}]);
|
|
items2 = [value13];
|
|
concat = items2.concat;
|
|
binding = Module00065Module;
|
|
exception3 = r32.exception;
|
|
values = exception3.values;
|
|
value14 = values.slice(1);
|
|
value = binding(value14);
|
|
value = Reflect.apply(concat, items2, [value]);
|
|
value = Reflect.apply(assign2, Object2, [{}, exception, {values: value}]);
|
|
object.exception = value;
|
|
Object4 = global.Object;
|
|
assign4 = Object4.assign;
|
|
extra = r32.extra;
|
|
value = value10.slice(0, a0);
|
|
value = Reflect.apply(assign4, Object4, [{}, extra, {['zoderror.issues']: value}]);
|
|
object.extra = value;
|
|
value = Reflect.apply(assign, Object, [{}, r32, object]);
|
|
} catch (error) {
|
|
Object = global.Object;
|
|
assign = Object.assign;
|
|
Object5 = global.Object;
|
|
assign5 = Object5.assign;
|
|
extra = r32.extra;
|
|
Error = global.Error;
|
|
value = 'unknown';
|
|
if (error instanceof Error) {
|
|
name = error.name;
|
|
message = error.message;
|
|
stack = error.stack;
|
|
value = '' + name + ': ' + message + '\n' + stack;
|
|
r9 = value;
|
|
} else {
|
|
r9 = value;
|
|
}
|
|
return Reflect.apply(assign, Object, [{}, r32, {extra: Reflect.apply(assign5, Object5,
|
|
[{},
|
|
extra,
|
|
{['zoderrors sentry integration parse error']: {message: 'an exception was thrown while processing ZodError within applyZodErrorsToEvent()',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
error: r9}}])}]);
|
|
}
|
|
return value;
|
|
}
|
|
return r32;
|
|
}
|
|
return r32;
|
|
}
|
|
return r32;
|
|
}
|
|
return r32;
|
|
}
|
|
}
|
|
return r32;
|
|
}
|
|
|
|
function _zodErrorsIntegration_60188() { // fn#60188, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7641:2061, offset: 0x016fdd8e, size: 80 bytes, params: 1, frame: 6
|
|
const r2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
let limit = r2.limit;
|
|
limit = limit === undefined ? 10 : r2.limit;
|
|
return {name: 'ZodErrors', processEvent: processEvent_60189};
|
|
function _zodErrorsIntegration_60188ProcessEvent(a0, a1) { // fn#60189, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7641:2225, owner: _zodErrorsIntegration_60188.processEvent, offset: 0x00d77f04, size: 38 bytes, params: 3, frame: 17
|
|
return applyZodErrorsToEvent_60187(limit, env0_0.saveZodIssuesAsAttachment, a0, a1);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function flattenIssue_60183(a0) { // fn#60183, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7641:95, offset: 0x00d7796c, size: 174 bytes, params: 2, frame: 20
|
|
const Object = global.Object;
|
|
const value = undefined;
|
|
return Object.assign({}, a0, {path: 'path' in a0 && global.Array.isArray(a0.path) ? a0.path.join('.') : value,
|
|
keys: 'keys' in a0 ? global.JSON.stringify(a0.keys) : value,
|
|
unionErrors: 'unionErrors' in a0 ? global.JSON.stringify(a0.unionErrors) : value});
|
|
}
|
|
|
|
function _fun60185(a0) { // fn#60185, offset: 0x00d77a3e, size: 25 bytes, params: 2, frame: 4
|
|
const value = a0;
|
|
return typeof value === 'number' ? '<array>' : value;
|
|
}
|
|
|
|
global.__d(_fun60182, 7463, [65, 7376, 7378, 7425]) /* metro module 7463, dependencies: [65, 7376, 7378, 7425] */;
|