Fix(installer): moved to ES6 syntax

This commit is contained in:
Gabriel Grubba
2022-08-05 16:49:23 -03:00
parent b1ec9419bf
commit 3e22eb0a1c

View File

@@ -204,17 +204,16 @@ makeInstaller = function (options) {
}
function makeMissingError(id) {
var path = String(id)
const path = String(id)
.split('/');
var importsFromServer = path.some(function (id) {
return id.indexOf('server') !== -1;
});
var importsFromClient = path.some(function (id) {
return id.indexOf('client') !== -1;
});
if (importsFromServer || importsFromClient) {
const importsFrom = (location) =>
path.some((id) => id.indexOf(location) !== -1);
if (importsFrom('server') || importsFrom('client')) {
return new Error('Cannot import module ' + id + ' \n (cross-boundary import) \n see: https://guide.meteor.com/structure.html#special-directories');
}
return new Error("Cannot find module '" + id + "'");
}