UNPKG

react-native-keys

Version:
33 lines (30 loc) 1.16 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _reactNative = require("react-native"); const LINKING_ERROR = `The package 'react-native-keys' doesn't seem to be linked. Make sure: \n\n` + _reactNative.Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo Go\n'; // @ts-expect-error const isTurboModuleEnabled = global.__turboModuleProxy != null; // Keep this to sync auto install with the native code const KeysModule = isTurboModuleEnabled ? require('./spec/NativeKeys').default : _reactNative.NativeModules.Keys; const KeysTurboModule = KeysModule ? KeysModule : new Proxy({}, { get() { throw new Error(LINKING_ERROR); } }); const installed = KeysTurboModule.install(); if (!installed) { throw new Error(LINKING_ERROR); } const KeysTurbo = global; Object.assign(KeysTurbo, { ...(_reactNative.Platform.OS === 'android' ? JSON.parse(KeysTurbo.publicKeys()) : KeysTurbo.publicKeys()) }); var _default = KeysTurbo; exports.default = _default; //# sourceMappingURL=index.js.map