From 3e22eb0a1c5d2725460ec85f72aca452007fafbb Mon Sep 17 00:00:00 2001 From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com> Date: Fri, 5 Aug 2022 16:49:23 -0300 Subject: [PATCH] Fix(installer): moved to ES6 syntax --- packages/modules-runtime-hot/installer.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/packages/modules-runtime-hot/installer.js b/packages/modules-runtime-hot/installer.js index b2197fb8ea..93745f749d 100644 --- a/packages/modules-runtime-hot/installer.js +++ b/packages/modules-runtime-hot/installer.js @@ -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 + "'"); }