252 lines
7.6 KiB
TypeScript
252 lines
7.6 KiB
TypeScript
// Module ID: 10358
|
|
// Function ID: 79907
|
|
// Name: getDisplayName
|
|
// Dependencies: [20, 22, 7022, 2]
|
|
// Exports: default
|
|
|
|
// Module 10358 (getDisplayName)
|
|
function getDisplayName(tag) {
|
|
if (null == tag.tag) {
|
|
let str3 = tag.label;
|
|
} else {
|
|
const _HermesInternal = HermesInternal;
|
|
str3 = "" + tag.label + " " + tag.tag;
|
|
}
|
|
let str4 = str3;
|
|
if (str3.includes("_START")) {
|
|
str4 = `Start ${str3.replace("_START", "")}`;
|
|
}
|
|
let text = str4;
|
|
if (str4.includes("_END")) {
|
|
text = `Finish ${str4.replace("_END", "")}`;
|
|
}
|
|
return text;
|
|
}
|
|
let result = require("getAccessibilityLabelFormatter").fileFinishedImporting("modules/debug/serializeAppStartLogs.tsx");
|
|
|
|
export default function serializeAppStartLogs(arg0) {
|
|
let flag = arg1;
|
|
let flag2 = arg2;
|
|
let closure_0 = arg0;
|
|
if (arg1 === undefined) {
|
|
flag = true;
|
|
}
|
|
if (flag2 === undefined) {
|
|
flag2 = true;
|
|
}
|
|
const logGroups = flag(flag2[0]).logGroups;
|
|
let mapped = logGroups.map((arg0) => {
|
|
let index;
|
|
let logs;
|
|
let nativeLogs;
|
|
let serverTrace;
|
|
let timestamp;
|
|
({ index, timestamp, logs, nativeLogs, serverTrace } = arg0);
|
|
let tmp = timestamp;
|
|
if (0 === index) {
|
|
timestamp = undefined;
|
|
const found = flag(flag2[1]).find(logs, (log) => {
|
|
log = log.log;
|
|
return log.indexOf("Logger loaded") >= 0;
|
|
});
|
|
if (null != found) {
|
|
timestamp = found.timestamp;
|
|
}
|
|
if (null == timestamp) {
|
|
timestamp = callback;
|
|
}
|
|
tmp = timestamp;
|
|
let arr = flag(flag2[1]);
|
|
}
|
|
let sum = index + 1;
|
|
const tmp7 = (function serializeLogGroup(arg0, arg1) {
|
|
let closure_0 = arg1;
|
|
const items = [];
|
|
let num = 0;
|
|
if (0 < arg0.length) {
|
|
while (true) {
|
|
let tmp = arg0[num];
|
|
let tmp2 = arg0[num + 1];
|
|
if (null != tmp2) {
|
|
let str = tmp.log;
|
|
if (tmp2.log === str.replace("Start ", "Finish ")) {
|
|
let str2 = tmp2.log;
|
|
tmp2.log = str2.replace("Finish ", "");
|
|
let arr = items.push(tmp2);
|
|
let sum = num + 1;
|
|
num = sum + 1;
|
|
if (num >= arg0.length) {
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
arr = items.push(tmp);
|
|
sum = num;
|
|
}
|
|
}
|
|
const mapped = items.map((timestamp) => {
|
|
const obj = {};
|
|
let str = "";
|
|
if (null != timestamp.timestamp) {
|
|
const result = (timestamp.timestamp - closure_0) / 1000;
|
|
str = result.toFixed(3);
|
|
}
|
|
obj.totalTime = str;
|
|
let str2 = "";
|
|
if (null != timestamp.delta) {
|
|
const _String = String;
|
|
const _Math = Math;
|
|
str2 = String(Math.round(timestamp.delta));
|
|
}
|
|
obj.deltaTime = str2;
|
|
let str3 = "";
|
|
if (timestamp.emoji.length > 0) {
|
|
const _HermesInternal = HermesInternal;
|
|
str3 = "" + timestamp.emoji + " ";
|
|
}
|
|
obj.log = "" + str3 + timestamp.prefix + timestamp.log + "\n";
|
|
return obj;
|
|
});
|
|
const maxResult = flag(flag2[1]).max(mapped.map((totalTime) => totalTime.totalTime.length));
|
|
let num2 = 0;
|
|
if (null != maxResult) {
|
|
num2 = maxResult;
|
|
}
|
|
let obj = flag(flag2[1]);
|
|
const maxResult1 = flag(flag2[1]).max(mapped.map((deltaTime) => deltaTime.deltaTime.length));
|
|
let num3 = 0;
|
|
if (null != maxResult1) {
|
|
num3 = maxResult1;
|
|
}
|
|
const mapped1 = mapped.map((arg0) => {
|
|
let deltaTime;
|
|
let log;
|
|
let totalTime;
|
|
({ totalTime, deltaTime, log } = arg0);
|
|
const obj = flag(flag2[1]);
|
|
const padStartResult = flag(flag2[1]).padStart(totalTime, num2);
|
|
return "" + padStartResult + " " + flag(flag2[1]).padStart(deltaTime, num3) + " " + log;
|
|
});
|
|
return mapped1.join("");
|
|
})((function joinLogs(logs, nativeLogs, flag, flag2) {
|
|
let closure_1 = flag;
|
|
let closure_2 = flag2;
|
|
const substr = logs.slice();
|
|
const set = new Set(nativeLogs.map(outer2_3));
|
|
let c4 = "";
|
|
let closure_5 = [];
|
|
const item = nativeLogs.forEach((autoGenerated) => {
|
|
const str = outer3_3(autoGenerated);
|
|
let tmp = closure_1;
|
|
if (!closure_1) {
|
|
tmp = !autoGenerated.autoGenerated;
|
|
}
|
|
let startsWithResult = str.startsWith("Start ");
|
|
if (startsWithResult) {
|
|
startsWithResult = !str.includes("RUN_JS_BUNDLE");
|
|
}
|
|
if (startsWithResult) {
|
|
startsWithResult = set.has(str.replace("Start ", "Finish "));
|
|
}
|
|
let num = 0;
|
|
let tmp4 = tmp;
|
|
if (str.startsWith("Finish ")) {
|
|
num = 0;
|
|
tmp4 = tmp;
|
|
if (!str.includes("RUN_JS_BUNDLE")) {
|
|
num = 0;
|
|
tmp4 = tmp;
|
|
if (set.has(str.replace("Finish ", "Start "))) {
|
|
_var = _var.substring(2);
|
|
arr = arr.pop();
|
|
num = 0;
|
|
tmp4 = tmp;
|
|
if (null != arr) {
|
|
const diff = autoGenerated.timestamp - arr.timestamp;
|
|
let tmp11 = tmp;
|
|
if (!tmp) {
|
|
tmp11 = diff > 5 && !(function isSuperNoisyLog(arg0) {
|
|
let closure_0 = arg0;
|
|
const items = ["GET_CONSTANTS", "CONVERT_CONSTANTS"];
|
|
return items.some(() => { ... });
|
|
})(str);
|
|
const tmp12 = diff > 5 && !(function isSuperNoisyLog(arg0) {
|
|
let closure_0 = arg0;
|
|
const items = ["GET_CONSTANTS", "CONVERT_CONSTANTS"];
|
|
return items.some(() => { ... });
|
|
})(str);
|
|
}
|
|
arr.shouldKeep = arr.shouldKeep || tmp11;
|
|
num = diff;
|
|
tmp4 = tmp11;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
const obj = { emoji: "\u2615", timestamp: autoGenerated.timestamp };
|
|
let tmp13;
|
|
if (num > 0) {
|
|
tmp13 = num;
|
|
}
|
|
obj.delta = tmp13;
|
|
obj.prefix = _var;
|
|
obj.log = str;
|
|
obj.shouldKeep = tmp4;
|
|
arr = substr;
|
|
let num4 = 0;
|
|
let num5 = 0;
|
|
if (0 < substr.length) {
|
|
while (true) {
|
|
let timestamp = arr[num4].timestamp;
|
|
if (null == timestamp) {
|
|
num4 = num4 + 1;
|
|
num5 = num4;
|
|
if (num4 >= arr.length) {
|
|
break;
|
|
}
|
|
} else {
|
|
num5 = num4;
|
|
if (timestamp > obj.timestamp) {
|
|
break;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
arr.splice(num5, 0, obj);
|
|
if (startsWithResult) {
|
|
_var = `${closure_4}| `;
|
|
arr = arr.push(obj);
|
|
}
|
|
});
|
|
let c6 = false;
|
|
return substr.filter((log) => {
|
|
let tmp = !c6;
|
|
if (!tmp) {
|
|
log = log.log;
|
|
tmp = !log.includes("\u21AA");
|
|
}
|
|
if (tmp) {
|
|
let tmp3 = !closure_2;
|
|
if (tmp3) {
|
|
tmp3 = "\u{1F3A8}" === log.emoji;
|
|
}
|
|
if (!tmp3) {
|
|
tmp3 = false === log.shouldKeep;
|
|
}
|
|
c6 = tmp3;
|
|
tmp = !tmp3;
|
|
}
|
|
return tmp;
|
|
});
|
|
})(logs, nativeLogs, flag, flag2), tmp);
|
|
const combined = "Trace #" + sum + " started " + callback(flag2[2]).getTimestampString(timestamp) + "\n" + tmp7;
|
|
let sum1 = combined;
|
|
if (null != serverTrace) {
|
|
let _HermesInternal = HermesInternal;
|
|
sum1 = combined + "\n Server trace for trace #" + index + 1 + serverTrace;
|
|
}
|
|
return sum1;
|
|
});
|
|
return mapped.join("\n\n");
|
|
};
|