This repository has been archived on 2022-03-12. You can view files and clone it, but cannot push or open issues or pull requests.
reValuate/node_modules/expo/build/removedModule.js
2021-04-02 02:24:13 +03:00

38 lines
1.3 KiB
JavaScript

let messages = [];
let packages = [];
let namedImports = [];
export default function removedModule(message, namedImport, packageName) {
if (__DEV__) {
messages.push(message);
packages.push(packageName);
namedImports.push(namedImport);
setTimeout(throwError, 1000);
}
}
function throwError() {
if (!messages.length) {
return;
}
let instructions = '';
messages = Array.from(new Set(messages));
messages.sort();
packages = Array.from(new Set(packages));
packages.sort();
namedImports = Array.from(new Set(namedImports));
namedImports.sort();
instructions += namedImports.join(', ');
instructions += `.\n\n`;
instructions += `1. Add correct versions of these packages to your project using:\n\n`;
instructions += ` expo install ${packages.join(' ')}\n\n`;
instructions += `2. Change your imports so they use specific packages instead of the "expo" package:\n\n`;
messages.forEach(message => {
instructions += ` - ${message}\n`;
});
instructions += '\n';
const message = `The following APIs have moved to separate packages and importing them from the "expo" package is no longer supported: ${instructions}`;
messages = [];
packages = [];
namedImports = [];
throw new Error(message);
}
//# sourceMappingURL=removedModule.js.map