decord/source/__polyfill/04xxx/module_4377.js
github-actions da5b5e5efe chore: update source for alpha 346.6
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4821.js (118.4 MB)
2026-09-12 13:45:10 +00:00

52 lines
1.9 KiB
JavaScript

// Module ID: 4377
// Function ID: 4378
// Dependencies: [17, 4378, 4379]
// Exports: isRuntimeAlive
// Module 4377
import _mod17 from "module_17" /* 17 */;
import _mod4378 from "module_4378" /* 4378 */;
import _mod4379 from "module_4379" /* 4379 */;
function getInstalledNitro() {
return global.NitroModulesProxy;
}
const TurboModuleRegistry = _mod17.TurboModuleRegistry;
const installedNitro = getInstalledNitro();
if (null != installedNitro) {
let installedNitro1 = installedNitro;
if (installedNitro.version !== _mod4378.version) {
const _Error2 = Error;
const version = installedNitro.version;
const _HermesInternal2 = HermesInternal;
const error = new Error("Nitro was installed twice: once with native version " + version + " and once with JS version " + _mod4378.version + ". This usually means react-native-nitro-modules exists multiple times in node_modules (e.g. in monorepos or double-linked setups).");
throw error;
}
} else {
try {
const enforcing = TurboModuleRegistry.getEnforcing("NitroModules");
const installResult = enforcing.install();
if (null != installResult) {
const _Error = Error;
const _HermesInternal = HermesInternal;
const error1 = new Error("Failed to install Nitro: " + installResult);
throw error1;
} else {
installedNitro1 = getInstalledNitro();
if (null == installedNitro1) {
const _Error3 = Error;
const error2 = new Error("NitroModules was installed, but `global.NitroModulesProxy` was null!");
const moduleNotFoundError = new _mod4379.ModuleNotFoundError(error2);
throw moduleNotFoundError;
}
}
} catch (tmp13) {
const moduleNotFoundError1 = new tmp3(tmp[2]).ModuleNotFoundError(tmp13);
throw moduleNotFoundError1;
}
}
export const NitroModules = installedNitro1;
export const isRuntimeAlive = function isRuntimeAlive() {
return null != globalThis.__nitroJsiCache && null != globalThis.__nitroDispatcher;
};