decord/source/3865_getInstalledNitro.js

49 lines
1.8 KiB
JavaScript
Raw Normal View History

2026-07-23 10:11:24 +00:00
// Module ID: 3865
2026-07-24 07:16:23 +00:00
// Function ID: 32122
2026-07-20 16:05:17 +00:00
// Name: getInstalledNitro
2026-07-23 10:11:24 +00:00
// Dependencies: [27, 3866, 3867]
2026-07-20 16:05:17 +00:00
// Exports: isRuntimeAlive
2026-07-23 10:11:24 +00:00
// Module 3865 (getInstalledNitro)
import { TurboModuleRegistry } from "get ActivityIndicator";
2026-07-20 16:05:17 +00:00
function getInstalledNitro() {
return global.NitroModulesProxy;
}
const installedNitro = getInstalledNitro();
let tmp3 = installedNitro;
if (null != installedNitro) {
2026-07-23 10:11:24 +00:00
if (tmp3.version !== require("items").version) {
2026-07-20 16:05:17 +00:00
const _Error2 = Error;
const version = tmp3.version;
const _HermesInternal2 = HermesInternal;
2026-07-23 10:11:24 +00:00
const error = new Error("Nitro was installed twice: once with native version " + version + " and once with JS version " + require("items").version + ". This usually means react-native-nitro-modules exists multiple times in node_modules (e.g. in monorepos or double-linked setups).");
2026-07-20 16:05:17 +00:00
throw error;
}
} else {
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: " + tmp21);
throw error1;
} else {
const installedNitro1 = getInstalledNitro();
tmp3 = installedNitro1;
if (null == installedNitro1) {
const _Error3 = Error;
const error2 = new Error("NitroModules was installed, but `global.NitroModulesProxy` was null!");
2026-07-23 10:11:24 +00:00
const ModuleNotFoundError = require("_callSuper").ModuleNotFoundError;
2026-07-20 16:05:17 +00:00
const prototype4 = ModuleNotFoundError.prototype;
const moduleNotFoundError = new ModuleNotFoundError(error2);
throw moduleNotFoundError;
}
}
}
export const NitroModules = tmp3;
export const isRuntimeAlive = function isRuntimeAlive() {
return null != globalThis.__nitroJsiCache && null != globalThis.__nitroDispatcher;
};