summaryrefslogtreecommitdiff
path: root/packages/core/src/utils
diff options
context:
space:
mode:
Diffstat (limited to 'packages/core/src/utils')
-rw-r--r--packages/core/src/utils/editCorrector.test.ts2
-rw-r--r--packages/core/src/utils/editor.test.ts4
-rw-r--r--packages/core/src/utils/fileUtils.test.ts6
-rw-r--r--packages/core/src/utils/fileUtils.ts2
-rw-r--r--packages/core/src/utils/getFolderStructure.test.ts2
-rw-r--r--packages/core/src/utils/paths.ts2
-rw-r--r--packages/core/src/utils/retry.ts2
7 files changed, 10 insertions, 10 deletions
diff --git a/packages/core/src/utils/editCorrector.test.ts b/packages/core/src/utils/editCorrector.test.ts
index cf9008ef..cd588312 100644
--- a/packages/core/src/utils/editCorrector.test.ts
+++ b/packages/core/src/utils/editCorrector.test.ts
@@ -81,7 +81,7 @@ describe('editCorrector', () => {
it('should correctly count occurrences when substring is longer', () => {
expect(countOccurrences('abc', 'abcdef')).toBe(0);
});
- it('should be case sensitive', () => {
+ it('should be case-sensitive', () => {
expect(countOccurrences('abcABC', 'a')).toBe(1);
expect(countOccurrences('abcABC', 'A')).toBe(1);
});
diff --git a/packages/core/src/utils/editor.test.ts b/packages/core/src/utils/editor.test.ts
index 86274be2..a86d6f59 100644
--- a/packages/core/src/utils/editor.test.ts
+++ b/packages/core/src/utils/editor.test.ts
@@ -202,7 +202,7 @@ describe('editor utils', () => {
});
}
- it(`should fallback to last command "${commands[commands.length - 1]}" when none exist on non-windows`, () => {
+ it(`should fall back to last command "${commands[commands.length - 1]}" when none exist on non-windows`, () => {
Object.defineProperty(process, 'platform', { value: 'linux' });
(execSync as Mock).mockImplementation(() => {
throw new Error(); // all commands not found
@@ -247,7 +247,7 @@ describe('editor utils', () => {
});
}
- it(`should fallback to last command "${win32Commands[win32Commands.length - 1]}" when none exist on windows`, () => {
+ it(`should fall back to last command "${win32Commands[win32Commands.length - 1]}" when none exist on windows`, () => {
Object.defineProperty(process, 'platform', { value: 'win32' });
(execSync as Mock).mockImplementation(() => {
throw new Error(); // all commands not found
diff --git a/packages/core/src/utils/fileUtils.test.ts b/packages/core/src/utils/fileUtils.test.ts
index 34aff79b..b8e75561 100644
--- a/packages/core/src/utils/fileUtils.test.ts
+++ b/packages/core/src/utils/fileUtils.test.ts
@@ -42,7 +42,7 @@ describe('fileUtils', () => {
let testImageFilePath: string;
let testPdfFilePath: string;
let testBinaryFilePath: string;
- let nonExistentFilePath: string;
+ let nonexistentFilePath: string;
let directoryPath: string;
beforeEach(() => {
@@ -57,7 +57,7 @@ describe('fileUtils', () => {
testImageFilePath = path.join(tempRootDir, 'image.png');
testPdfFilePath = path.join(tempRootDir, 'document.pdf');
testBinaryFilePath = path.join(tempRootDir, 'app.exe');
- nonExistentFilePath = path.join(tempRootDir, 'notfound.txt');
+ nonexistentFilePath = path.join(tempRootDir, 'nonexistent.txt');
directoryPath = path.join(tempRootDir, 'subdir');
actualNodeFs.mkdirSync(directoryPath, { recursive: true }); // Ensure subdir exists
@@ -284,7 +284,7 @@ describe('fileUtils', () => {
it('should handle file not found', async () => {
const result = await processSingleFileContent(
- nonExistentFilePath,
+ nonexistentFilePath,
tempRootDir,
);
expect(result.error).toContain('File not found');
diff --git a/packages/core/src/utils/fileUtils.ts b/packages/core/src/utils/fileUtils.ts
index 1489c4ee..6b5ce42c 100644
--- a/packages/core/src/utils/fileUtils.ts
+++ b/packages/core/src/utils/fileUtils.ts
@@ -185,7 +185,7 @@ export async function detectFileType(
return 'binary';
}
- // Fallback to content-based check if mime type wasn't conclusive for image/pdf
+ // Fall back to content-based check if mime type wasn't conclusive for image/pdf
// and it's not a known binary extension.
if (await isBinaryFile(filePath)) {
return 'binary';
diff --git a/packages/core/src/utils/getFolderStructure.test.ts b/packages/core/src/utils/getFolderStructure.test.ts
index b6354745..b2da4aab 100644
--- a/packages/core/src/utils/getFolderStructure.test.ts
+++ b/packages/core/src/utils/getFolderStructure.test.ts
@@ -245,7 +245,7 @@ Showing up to 1 items (files + folders). Folders or files indicated with ... con
expect(structure.trim()).toBe(expectedRevisedMax1);
});
- it('should handle non-existent directory', async () => {
+ it('should handle nonexistent directory', async () => {
// Temporarily make fsPromises.readdir throw ENOENT for this specific path
const originalReaddir = fsPromises.readdir;
(fsPromises.readdir as Mock).mockImplementation(
diff --git a/packages/core/src/utils/paths.ts b/packages/core/src/utils/paths.ts
index 16adbee4..3382c588 100644
--- a/packages/core/src/utils/paths.ts
+++ b/packages/core/src/utils/paths.ts
@@ -44,7 +44,7 @@ export function shortenPath(filePath: string, maxLen: number = 35): string {
// Handle cases with no segments after root (e.g., "/", "C:\") or only one segment
if (segments.length <= 1) {
- // Fallback to simple start/end truncation for very short paths or single segments
+ // Fall back to simple start/end truncation for very short paths or single segments
const keepLen = Math.floor((maxLen - 3) / 2);
// Ensure keepLen is not negative if maxLen is very small
if (keepLen <= 0) {
diff --git a/packages/core/src/utils/retry.ts b/packages/core/src/utils/retry.ts
index bf4532bc..b29bf7df 100644
--- a/packages/core/src/utils/retry.ts
+++ b/packages/core/src/utils/retry.ts
@@ -196,7 +196,7 @@ export async function retryWithBackoff<T>(
// Reset currentDelay for next potential non-429 error, or if Retry-After is not present next time
currentDelay = initialDelayMs;
} else {
- // Fallback to exponential backoff with jitter
+ // Fall back to exponential backoff with jitter
logRetryAttempt(attempt, error, errorStatus);
// Add jitter: +/- 30% of currentDelay
const jitter = currentDelay * 0.3 * (Math.random() * 2 - 1);