118 lines
3.1 KiB
JavaScript
118 lines
3.1 KiB
JavaScript
// Metro module 1320 (f1321).
|
|
import { lowerCamelCase } from "./Module1321";
|
|
let ScalarType = exports.ScalarType;
|
|
if (!ScalarType) {
|
|
const ScalarType2 = {};
|
|
exports.ScalarType = ScalarType2;
|
|
ScalarType = ScalarType2;
|
|
}
|
|
ScalarType.DOUBLE = 1;
|
|
ScalarType[1] = "DOUBLE";
|
|
ScalarType.FLOAT = 2;
|
|
ScalarType[2] = "FLOAT";
|
|
ScalarType.INT64 = 3;
|
|
ScalarType[3] = "INT64";
|
|
ScalarType.UINT64 = 4;
|
|
ScalarType[4] = "UINT64";
|
|
ScalarType.INT32 = 5;
|
|
ScalarType[5] = "INT32";
|
|
ScalarType.FIXED64 = 6;
|
|
ScalarType[6] = "FIXED64";
|
|
ScalarType.FIXED32 = 7;
|
|
ScalarType[7] = "FIXED32";
|
|
ScalarType.BOOL = 8;
|
|
ScalarType[8] = "BOOL";
|
|
ScalarType.STRING = 9;
|
|
ScalarType[9] = "STRING";
|
|
ScalarType.BYTES = 12;
|
|
ScalarType[12] = "BYTES";
|
|
ScalarType.UINT32 = 13;
|
|
ScalarType[13] = "UINT32";
|
|
ScalarType.SFIXED32 = 15;
|
|
ScalarType[15] = "SFIXED32";
|
|
ScalarType.SFIXED64 = 16;
|
|
ScalarType[16] = "SFIXED64";
|
|
ScalarType.SINT32 = 17;
|
|
ScalarType[17] = "SINT32";
|
|
ScalarType.SINT64 = 18;
|
|
ScalarType[18] = "SINT64";
|
|
let LongType = exports.LongType;
|
|
if (!LongType) {
|
|
const LongType2 = {};
|
|
exports.LongType = LongType2;
|
|
LongType = LongType2;
|
|
}
|
|
LongType.BIGINT = 0;
|
|
LongType[0] = "BIGINT";
|
|
LongType.STRING = 1;
|
|
LongType[1] = "STRING";
|
|
LongType.NUMBER = 2;
|
|
LongType[2] = "NUMBER";
|
|
let RepeatType2 = exports.RepeatType;
|
|
if (!RepeatType2) {
|
|
const RepeatType3 = {};
|
|
exports.RepeatType = RepeatType3;
|
|
RepeatType2 = RepeatType3;
|
|
}
|
|
const RepeatType = RepeatType2;
|
|
RepeatType.NO = 0;
|
|
RepeatType[0] = "NO";
|
|
RepeatType.PACKED = 1;
|
|
RepeatType[1] = "PACKED";
|
|
RepeatType.UNPACKED = 2;
|
|
RepeatType[2] = "UNPACKED";
|
|
export function normalizeFieldInfo(a0) {
|
|
let localName = a0.localName;
|
|
if (!(localName !== null && localName !== void 0)) {
|
|
localName = lowerCamelCase(a0.name);
|
|
}
|
|
a0.localName = localName;
|
|
let jsonName = a0.jsonName;
|
|
if (!(jsonName !== null && jsonName !== void 0)) {
|
|
jsonName = lowerCamelCase(a0.name);
|
|
}
|
|
a0.jsonName = jsonName;
|
|
let repeat = a0.repeat;
|
|
if (!(repeat !== null && repeat !== void 0)) {
|
|
repeat = RepeatType.NO;
|
|
}
|
|
a0.repeat = repeat;
|
|
let opt = a0.opt;
|
|
if (!(opt !== null && opt !== void 0)) {
|
|
const repeat2 = a0.repeat;
|
|
let r28 = !repeat2;
|
|
if (!repeat2) {
|
|
const oneof = a0.oneof;
|
|
r28 = oneof ? !oneof : a0.kind == "message";
|
|
}
|
|
opt = r28;
|
|
}
|
|
a0.opt = opt;
|
|
return a0;
|
|
}
|
|
export function readFieldOptions(a0, c12959_0, a2, a3) {
|
|
const r10 = a0.fields.find(({ localName }, index) => localName == c12959_0 || index == c12959_0);
|
|
const r6 = r10 !== null ? r10 !== void 0 ? r10.options : void 0 : void 0;
|
|
return r6 ? r6[a2] ? a3.fromJson(r6[a2]) : void 0 : void 0;
|
|
}
|
|
export function readFieldOption(a0, c12960_0, a2, a3) {
|
|
const r10 = a0.fields.find(({ localName }, index) => localName == c12960_0 || index == c12960_0);
|
|
const r11 = r10 !== null ? r10 !== void 0 ? r10.options : void 0 : void 0;
|
|
if (r11) {
|
|
const r6 = r11[a2];
|
|
let r13 = r6;
|
|
if (r13 !== void 0) {
|
|
r13 = a3 ? a3.fromJson(r6) : r6;
|
|
}
|
|
return r13;
|
|
}
|
|
}
|
|
export function readMessageOption(a0, a1, a2) {
|
|
const r5 = a0.options[a1];
|
|
let r7 = r5;
|
|
if (r7 !== void 0) {
|
|
r7 = a2 ? a2.fromJson(r5) : r5;
|
|
}
|
|
return r7;
|
|
}
|