Remove unnecessary path.normalize() calls

`path.join()` already normalizes.
This commit is contained in:
Richard Hansen 2021-02-10 01:12:43 -05:00 committed by John McLear
parent 84c1d74f8b
commit f868788417
6 changed files with 9 additions and 10 deletions

View file

@ -32,7 +32,7 @@ exports.formatHooks = (hookSetName) => {
const callInit = async () => {
await Promise.all(Object.keys(defs.plugins).map(async (pluginName) => {
const plugin = defs.plugins[pluginName];
const epInit = path.normalize(path.join(plugin.package.path, '.ep_initialized'));
const epInit = path.join(plugin.package.path, '.ep_initialized');
try {
await fs.stat(epInit);
} catch (err) {
@ -48,7 +48,7 @@ exports.pathNormalization = (part, hookFnName, hookName) => {
const functionName = (tmp.length > 1 ? tmp.pop() : null) || hookName;
const moduleName = tmp.join(':') || part.plugin;
const packageDir = path.dirname(defs.plugins[part.plugin].package.path);
const fileName = path.normalize(path.join(packageDir, moduleName));
const fileName = path.join(packageDir, moduleName);
return `${fileName}:${functionName}`;
};