decord/source/modules/user_settings/UserSettingsProtoUtils.tsx
github-actions f0f877e8ce chore: update source for alpha 347.1
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4824.js (118.4 MB)
2026-09-15 14:23:42 +00:00

40 lines
1.4 KiB
TypeScript

// Module ID: 1942
// Function ID: 1943
// Name: UserSettingsProtoUtils
// Dependencies: [1223, 2]
// Exports: createModifiedProto, getProtoFieldClass
// Module 1942 (UserSettingsProtoUtils)
import ProtoUtils from "ProtoUtils" /* 1223 */;
import size from "module_2" /* 2 */;
const result = size.fileFinishedImporting("modules/user_settings/UserSettingsProtoUtils.tsx");
export const getProtoFieldClass = function getProtoFieldClass(PreloadedUserSettings, field) {
closure_0 = field;
const fields = PreloadedUserSettings.fields;
const found = fields.find((localName) => localName.localName === closure_0);
if (null == found) {
const _Error = Error;
const _String = String;
const _HermesInternal = HermesInternal;
throw Error("Unknown proto field name " + String(field));
} else {
return found.T();
}
};
export const createModifiedProto = function createModifiedProto(favoriteGifs, fn, protoFieldClass, PreloadedUserSettings, arg4) {
if (null != favoriteGifs) {
let fromBinaryResult = protoFieldClass.fromBinary(protoFieldClass.toBinary(favoriteGifs), ProtoUtils.BINARY_READ_OPTIONS);
const toBinaryResult = protoFieldClass.toBinary(favoriteGifs);
} else {
fromBinaryResult = protoFieldClass.create();
}
if (false === fn(fromBinaryResult)) {
return null;
} else {
const obj = PreloadedUserSettings.create();
obj[arg4] = fromBinaryResult;
return obj;
}
};