decord/source/modules/user_settings/UserSettingsProtoUtils.tsx

38 lines
1.4 KiB
TypeScript
Raw Normal View History

2026-07-20 16:05:17 +00:00
// Module ID: 1332
2026-07-25 08:10:48 +00:00
// Function ID: 15649
2026-07-20 16:05:17 +00:00
// Name: getProtoFieldClass
2026-07-23 10:11:24 +00:00
// Dependencies: [1318, 2]
2026-07-20 16:05:17 +00:00
// Exports: createModifiedProto, getProtoFieldClass
// Module 1332 (getProtoFieldClass)
2026-07-23 10:11:24 +00:00
const result = require("set").fileFinishedImporting("modules/user_settings/UserSettingsProtoUtils.tsx");
2026-07-20 16:05:17 +00:00
2026-07-23 10:11:24 +00:00
export const getProtoFieldClass = function getProtoFieldClass(PreloadedUserSettings, outer1_1) {
let closure_0 = outer1_1;
2026-07-20 16:05:17 +00:00
const fields = PreloadedUserSettings.fields;
2026-07-23 10:11:24 +00:00
const found = fields.find((localName) => localName.localName === closure_0);
2026-07-20 16:05:17 +00:00
if (null == found) {
const _Error = Error;
const _String = String;
const _HermesInternal = HermesInternal;
2026-07-23 10:11:24 +00:00
throw Error("Unknown proto field name " + String(outer1_1));
2026-07-20 16:05:17 +00:00
} else {
return found.T();
}
};
2026-07-23 10:11:24 +00:00
export const createModifiedProto = function createModifiedProto(favoriteGifs, outer1_2, protoFieldClass, PreloadedUserSettings, outer1_1) {
2026-07-20 16:05:17 +00:00
if (null != favoriteGifs) {
2026-07-23 10:11:24 +00:00
let fromBinaryResult = protoFieldClass.fromBinary(protoFieldClass.toBinary(favoriteGifs), require(1318) /* _createForOfIteratorHelperLoose */.BINARY_READ_OPTIONS);
2026-07-20 16:05:17 +00:00
const toBinaryResult = protoFieldClass.toBinary(favoriteGifs);
} else {
fromBinaryResult = protoFieldClass.create();
}
2026-07-23 10:11:24 +00:00
if (false === outer1_2(fromBinaryResult)) {
2026-07-20 16:05:17 +00:00
return null;
} else {
const obj = PreloadedUserSettings.create();
2026-07-23 10:11:24 +00:00
obj[outer1_1] = fromBinaryResult;
2026-07-20 16:05:17 +00:00
return obj;
}
};