UNPKG

bit-bin

Version:

<a href="https://opensource.org/licenses/Apache-2.0"><img alt="apache" src="https://img.shields.io/badge/License-Apache%202.0-blue.svg"></a> <a href="https://github.com/teambit/bit/blob/master/CONTRIBUTING.md"><img alt="prs" src="https://img.shields.io/b

40 lines (29 loc) 750 B
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports.default = isDir; function _fsExtra() { const data = _interopRequireDefault(require("fs-extra")); _fsExtra = function () { return data; }; return data; } function _generalError() { const data = _interopRequireDefault(require("../error/general-error")); _generalError = function () { return data; }; return data; } function isDir(userPath) { let stat; try { stat = _fsExtra().default.lstatSync(userPath); } catch (err) { throw new (_generalError().default)(`The path ${userPath} doesn't exist`); } return stat.isDirectory(); }