decord/beta/source/modules/user_settings/UserSettingsProtoUtils.tsx
github-actions e7a050048e chore: update source for beta 347.7
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4943.js (118.4 MB)
2026-09-21 19:31:18 +00:00

40 lines
1.4 KiB
TypeScript

// Module ID: 2029
// Function ID: 2030
// Name: UserSettingsProtoUtils
// Dependencies: [1227, 2]
// Exports: createModifiedProto, getProtoFieldClass
// Module 2029 (UserSettingsProtoUtils)
import ProtoUtils from "ProtoUtils" /* 1227 */;
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;
}
};