source: trip-planner-front/node_modules/cosmiconfig/dist/getDirectory.js@ 571e0df

Last change on this file since 571e0df was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 900 bytes
Line 
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.getDirectory = getDirectory;
7exports.getDirectorySync = getDirectorySync;
8
9var _path = _interopRequireDefault(require("path"));
10
11var _pathType = require("path-type");
12
13function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
15async function getDirectory(filepath) {
16 const filePathIsDirectory = await (0, _pathType.isDirectory)(filepath);
17
18 if (filePathIsDirectory === true) {
19 return filepath;
20 }
21
22 const directory = _path.default.dirname(filepath);
23
24 return directory;
25}
26
27function getDirectorySync(filepath) {
28 const filePathIsDirectory = (0, _pathType.isDirectorySync)(filepath);
29
30 if (filePathIsDirectory === true) {
31 return filepath;
32 }
33
34 const directory = _path.default.dirname(filepath);
35
36 return directory;
37}
38//# sourceMappingURL=getDirectory.js.map
Note: See TracBrowser for help on using the repository browser.