cosmiconfig
Advanced tools
Comparing version 9.0.0-alpha.2 to 9.0.0-alpha.3
@@ -9,3 +9,2 @@ "use strict"; | ||
const path_1 = __importDefault(require("path")); | ||
const path_type_1 = require("path-type"); | ||
const defaults_1 = require("./defaults"); | ||
@@ -49,3 +48,3 @@ const ExplorerBase_js_1 = require("./ExplorerBase.js"); | ||
/* istanbul ignore if -- @preserve */ | ||
if (await (0, path_type_1.isDirectory)(currentDir.path)) { | ||
if (await (0, util_js_1.isDirectory)(currentDir.path)) { | ||
for (const filepath of this.getSearchPlacesForDir(currentDir, defaults_1.globalConfigSearchPlaces)) { | ||
@@ -52,0 +51,0 @@ try { |
@@ -9,3 +9,2 @@ "use strict"; | ||
const path_1 = __importDefault(require("path")); | ||
const path_type_1 = require("path-type"); | ||
const defaults_1 = require("./defaults"); | ||
@@ -49,3 +48,3 @@ const ExplorerBase_js_1 = require("./ExplorerBase.js"); | ||
/* istanbul ignore if -- @preserve */ | ||
if ((0, path_type_1.isDirectorySync)(currentDir.path)) { | ||
if ((0, util_js_1.isDirectorySync)(currentDir.path)) { | ||
for (const filepath of this.getSearchPlacesForDir(currentDir, defaults_1.globalConfigSearchPlacesSync)) { | ||
@@ -52,0 +51,0 @@ try { |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.removeUndefinedValuesFromObject = exports.getPropertyByPath = exports.emplace = void 0; | ||
exports.isDirectorySync = exports.isDirectory = exports.removeUndefinedValuesFromObject = exports.getPropertyByPath = exports.emplace = void 0; | ||
const fs_1 = __importStar(require("fs")); | ||
/** | ||
@@ -45,2 +69,32 @@ * @internal | ||
exports.removeUndefinedValuesFromObject = removeUndefinedValuesFromObject; | ||
/** @internal */ | ||
/* istanbul ignore next -- @preserve */ | ||
async function isDirectory(path) { | ||
try { | ||
const stat = await fs_1.promises.stat(path); | ||
return stat.isDirectory(); | ||
} | ||
catch (e) { | ||
if (e.code === 'ENOENT') { | ||
return false; | ||
} | ||
throw e; | ||
} | ||
} | ||
exports.isDirectory = isDirectory; | ||
/** @internal */ | ||
/* istanbul ignore next -- @preserve */ | ||
function isDirectorySync(path) { | ||
try { | ||
const stat = fs_1.default.statSync(path); | ||
return stat.isDirectory(); | ||
} | ||
catch (e) { | ||
if (e.code === 'ENOENT') { | ||
return false; | ||
} | ||
throw e; | ||
} | ||
} | ||
exports.isDirectorySync = isDirectorySync; | ||
//# sourceMappingURL=util.js.map |
{ | ||
"name": "cosmiconfig", | ||
"version": "9.0.0-alpha.2", | ||
"version": "9.0.0-alpha.3", | ||
"description": "Find and load configuration from a package.json property, rc file, TypeScript module, and more!", | ||
@@ -74,4 +74,3 @@ "main": "dist/index.js", | ||
"js-yaml": "^4.1.0", | ||
"parse-json": "^5.2.0", | ||
"path-type": "^4.0.0" | ||
"parse-json": "^5.2.0" | ||
}, | ||
@@ -86,4 +85,2 @@ "devDependencies": { | ||
"cross-env": "^7.0.3", | ||
"del": "^7.1.0", | ||
"del-cli": "^5.1.0", | ||
"eslint": "^8.48.0", | ||
@@ -98,3 +95,2 @@ "eslint-config-davidtheclark-node": "^0.2.2", | ||
"lint-staged": "^14.0.1", | ||
"make-dir": "^4.0.0", | ||
"parent-module": "^3.0.0", | ||
@@ -101,0 +97,0 @@ "prettier": "^3.0.3", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
108890
5
21
1160
5
- Removedpath-type@^4.0.0
- Removedpath-type@4.0.0(transitive)