decord/source/utils/native/requireNativeComponentOrDefault.native.tsx

49 lines
1.6 KiB
TypeScript
Raw Normal View History

2026-08-07 06:50:47 +00:00
// Module ID: 4705
// Function ID: 4706
2026-07-20 16:05:17 +00:00
// Name: map
2026-07-29 08:29:29 +00:00
// Dependencies: [17, 3, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-07 06:50:47 +00:00
// Module 4705 (map)
2026-07-23 10:11:24 +00:00
import get_ActivityIndicator from "get ActivityIndicator";
2026-07-29 08:29:29 +00:00
let c0;
2026-07-23 10:11:24 +00:00
let closure_1;
2026-07-29 08:29:29 +00:00
let obj1;
({ requireNativeComponent: c0, UIManager: closure_1, View: obj1 } = get_ActivityIndicator);
let c3 = new require("timestamp")("RequireNativeComponentOrDefault");
2026-07-20 16:05:17 +00:00
const map = new Map();
2026-07-29 08:29:29 +00:00
const tmp3 = new require("timestamp")("RequireNativeComponentOrDefault");
2026-07-23 10:11:24 +00:00
let result = require("set").fileFinishedImporting("utils/native/requireNativeComponentOrDefault.native.tsx");
2026-07-20 16:05:17 +00:00
export default function requireNativeComponentOrDefault(warnWhenMissing) {
let componentFoundInstance;
let componentMissingFallbackInstance;
let componentName;
({ componentName, componentFoundInstance, componentMissingFallbackInstance } = warnWhenMissing);
if (componentMissingFallbackInstance === undefined) {
componentMissingFallbackInstance = closure_2;
}
let flag = warnWhenMissing.warnWhenMissing;
if (flag === undefined) {
flag = true;
}
if (closure_1.hasViewManagerConfig(componentName)) {
if (!map.has(componentName)) {
2026-07-29 08:29:29 +00:00
if (componentFoundInstance == null) {
2026-07-20 16:05:17 +00:00
componentFoundInstance = callback(componentName);
}
2026-07-29 08:29:29 +00:00
const result = obj.set(componentName, componentFoundInstance);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let value = obj.get(componentName);
2026-07-20 16:05:17 +00:00
} else {
value = componentMissingFallbackInstance;
if (flag) {
const _HermesInternal = HermesInternal;
2026-07-29 08:29:29 +00:00
globalThis.warn("" + componentName + " not found, you are likely on a branch override without the native code.");
2026-07-20 16:05:17 +00:00
value = componentMissingFallbackInstance;
}
}
return value;
};