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

@@ -4,14 +4,7 @@
const path = require('path');
const isDirectory = require('is-directory');
module.exports = function getDirectory(
filepath ,
sync
) {
if (sync === true) {
return isDirectory.sync(filepath) ? filepath : path.dirname(filepath);
}
function getDirectory(filepath ) {
return new Promise((resolve, reject) => {
return isDirectory(filepath, (err, filepathIsDirectory) => {
if (err) {
@@ -20,4 +13,10 @@ module.exports = function getDirectory(
return resolve(filepathIsDirectory ? filepath : path.dirname(filepath));
});
});
}
getDirectory.sync = function getDirectorySync(filepath ) {
return isDirectory.sync(filepath) ? filepath : path.dirname(filepath);
};
module.exports = getDirectory;