22 lines
810 B
JavaScript
22 lines
810 B
JavaScript
// Metro module 1910 (f1911).
|
|
import { NativeModules } from "react-native";
|
|
let __KvStorage;
|
|
if (global.__KvStorage != null) {
|
|
__KvStorage = global.__KvStorage;
|
|
} else {
|
|
if (NativeModules.KvStorage == null) {
|
|
throw new Error("couldn't find the native kv_storage module.");
|
|
}
|
|
if (!(NativeModules.KvStorage.activate instanceof Function)) {
|
|
throw new Error("couldn't start the storage subsystem: native module exists, but jsi might not be available?");
|
|
}
|
|
if (!NativeModules.KvStorage.activate()) {
|
|
throw new Error("couldn't start the storage subsystem: activation failed.");
|
|
}
|
|
if (global.__KvStorage == null) {
|
|
throw new Error("couldn't start the storage subsystem: subsystem missing after activation.");
|
|
}
|
|
__KvStorage = global.__KvStorage;
|
|
}
|
|
export { __KvStorage as KV_RAW };
|