react-native-fs-turbo
Version:
React-Native library for working with Android/iOS file system, written using JSI and C++ TurboModules
31 lines (30 loc) • 1.19 kB
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ModuleNotFoundError = void 0;
const BULLET_POINT = "\n* ";
function messageWithSuggestions(message, suggestions) {
return message + BULLET_POINT + suggestions.join(BULLET_POINT);
}
class ModuleNotFoundError extends Error {
constructor() {
// TurboModule not found, something went wrong!
// eslint-disable-next-line no-underscore-dangle
if (global.__turboModuleProxy == null) {
// TurboModules are not available/new arch is not enabled.
// react-native-fs-turbo requires new arch (react-native >0.74)
const message = "Failed to create a new RNFSTurbo instance: react-native-fs-turbo requires TurboModules, but the new architecture is not enabled!";
const suggestions = [];
const error = messageWithSuggestions(message, suggestions);
super(error);
return;
}
const message = "Failed to create a new RNFSTurbo instance.";
const suggestions = [];
const error = messageWithSuggestions(message, suggestions);
super(error);
}
}
exports.ModuleNotFoundError = ModuleNotFoundError;
//# sourceMappingURL=ModuleNotFoundError.js.map
;