@code-pushup/utils 0.8.14 → 0.8.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -667,6 +667,14 @@ async function fileExists(path) {
667
667
  return false;
668
668
  }
669
669
  }
670
+ async function directoryExists(path) {
671
+ try {
672
+ const stats = await stat(path);
673
+ return stats.isDirectory();
674
+ } catch {
675
+ return false;
676
+ }
677
+ }
670
678
  async function ensureDirectoryExists(baseDir) {
671
679
  try {
672
680
  await mkdir(baseDir, { recursive: true });
@@ -1650,6 +1658,7 @@ export {
1650
1658
  compareIssueSeverity,
1651
1659
  countOccurrences,
1652
1660
  crawlFileSystem,
1661
+ directoryExists,
1653
1662
  distinct,
1654
1663
  ensureDirectoryExists,
1655
1664
  executeProcess,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@code-pushup/utils",
3
- "version": "0.8.14",
3
+ "version": "0.8.16",
4
4
  "dependencies": {
5
5
  "@code-pushup/models": "*",
6
6
  "bundle-require": "^4.0.1",
package/src/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { ProcessConfig, ProcessError, ProcessObserver, ProcessResult, executeProcess, } from './lib/execute-process';
2
- export { CrawlFileSystemOptions, FileResult, MultipleFileResults, crawlFileSystem, ensureDirectoryExists, fileExists, findLineNumberInText, importEsmModule, logMultipleFileResults, pluginWorkDir, readJsonFile, readTextFile, } from './lib/file-system';
2
+ export { CrawlFileSystemOptions, FileResult, MultipleFileResults, crawlFileSystem, directoryExists, ensureDirectoryExists, fileExists, findLineNumberInText, importEsmModule, logMultipleFileResults, pluginWorkDir, readJsonFile, readTextFile, } from './lib/file-system';
3
3
  export { formatBytes, formatDuration, pluralize, pluralizeToken, slugify, truncateDescription, truncateIssueMessage, truncateText, truncateTitle, } from './lib/formatting';
4
4
  export { getLatestCommit, git } from './lib/git';
5
5
  export { groupByStatus } from './lib/group-by-status';
@@ -2,6 +2,7 @@ import { type Options } from 'bundle-require';
2
2
  export declare function readTextFile(path: string): Promise<string>;
3
3
  export declare function readJsonFile<T = unknown>(path: string): Promise<T>;
4
4
  export declare function fileExists(path: string): Promise<boolean>;
5
+ export declare function directoryExists(path: string): Promise<boolean>;
5
6
  export declare function ensureDirectoryExists(baseDir: string): Promise<void>;
6
7
  export type FileResult = readonly [string] | readonly [string, number];
7
8
  export type MultipleFileResults = PromiseSettledResult<FileResult>[];