nav tabs on admin dashboard

This commit is contained in:
2019-03-07 00:20:34 -06:00
parent f73d6ae228
commit e4f473f376
11661 changed files with 216240 additions and 1544253 deletions

View File

@@ -1,30 +1,11 @@
var path = require('path');
var fs = require('fs');
var parse = path.parse || require('path-parse');
module.exports = function nodeModulesPaths(start, opts) {
var modules = opts && opts.moduleDirectory
? [].concat(opts.moduleDirectory)
: ['node_modules'];
// ensure that `start` is an absolute path at this point,
// resolving against the process' current working directory
var absoluteStart = path.resolve(start);
if (opts && opts.preserveSymlinks === false) {
try {
absoluteStart = fs.realpathSync(absoluteStart);
} catch (err) {
if (err.code !== 'ENOENT') {
throw err;
}
}
}
var getNodeModulesDirs = function getNodeModulesDirs(absoluteStart, modules) {
var prefix = '/';
if (/^([A-Za-z]:)/.test(absoluteStart)) {
if ((/^([A-Za-z]:)/).test(absoluteStart)) {
prefix = '';
} else if (/^\\\\/.test(absoluteStart)) {
} else if ((/^\\\\/).test(absoluteStart)) {
prefix = '\\\\';
}
@@ -35,11 +16,27 @@ module.exports = function nodeModulesPaths(start, opts) {
parsed = parse(parsed.dir);
}
var dirs = paths.reduce(function (dirs, aPath) {
return paths.reduce(function (dirs, aPath) {
return dirs.concat(modules.map(function (moduleDir) {
return path.join(prefix, aPath, moduleDir);
}));
}, []);
};
module.exports = function nodeModulesPaths(start, opts, request) {
var modules = opts && opts.moduleDirectory
? [].concat(opts.moduleDirectory)
: ['node_modules'];
if (opts && typeof opts.paths === 'function') {
return opts.paths(
request,
start,
function () { return getNodeModulesDirs(start, modules); },
opts
);
}
var dirs = getNodeModulesDirs(start, modules);
return opts && opts.paths ? dirs.concat(opts.paths) : dirs;
};