From 828d91a8a82202f98fc3f4c935aba38e72fd3c90 Mon Sep 17 00:00:00 2001 From: Andrej Badin Date: Wed, 20 May 2020 02:28:38 +0200 Subject: [PATCH] `resolve` function should behave as `path.resolve` I strongly believe `appRoot.resolve` should behave as `path.resolve` does. It means: - given relative path, resolve absolute path relative to the app root - given absolute path, resolve given absolute path --- lib/app-root-path.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/app-root-path.js b/lib/app-root-path.js index 03596e5..3c73c1c 100644 --- a/lib/app-root-path.js +++ b/lib/app-root-path.js @@ -7,7 +7,7 @@ module.exports = function(dirname) { var publicInterface = { resolve: function(pathToModule) { - return path.join(appRootPath, pathToModule); + return path.resolve(appRootPath, pathToModule); }, require: function(pathToModule) { @@ -27,4 +27,4 @@ module.exports = function(dirname) { }; return publicInterface; -}; \ No newline at end of file +};