From 365cdb8411eba6937a091494f267af550da23ced Mon Sep 17 00:00:00 2001 From: Chrilleweb Date: Sat, 15 Aug 2026 08:40:34 +0200 Subject: [PATCH 1/2] chore(docs): updated JSDocs --- packages/cli/src/core/envLine.ts | 3 +++ packages/cli/src/core/suggestTypos.ts | 14 ++++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/packages/cli/src/core/envLine.ts b/packages/cli/src/core/envLine.ts index 5578b1fb..743b957b 100644 --- a/packages/cli/src/core/envLine.ts +++ b/packages/cli/src/core/envLine.ts @@ -2,10 +2,13 @@ * This module provides utility functions for parsing and handling dotenv files. */ export interface EnvKeyValue { + /** The key of the environment variable. */ key: string; + /** The value of the environment variable. */ value: string; } +/** BOM (Byte Order Mark) character used to indicate UTF-8 encoding. */ const BOM = '\uFEFF'; /** Strips a UTF-8 BOM from the start of the content, if present. diff --git a/packages/cli/src/core/suggestTypos.ts b/packages/cli/src/core/suggestTypos.ts index 85ac49fa..f53a2155 100644 --- a/packages/cli/src/core/suggestTypos.ts +++ b/packages/cli/src/core/suggestTypos.ts @@ -2,6 +2,16 @@ import type { TypoSuggestion } from '../config/types.js'; import { MAX_TYPO_DISTANCE, MAX_TYPO_RATIO } from '../config/constants.js'; import { levenshtein } from './helpers/levenshtein.js'; +/** + * A candidate key that qualifies as a likely typo of a reported key + */ +interface ClosestMatch { + /** The candidate key from the existing key pool */ + key: string; + /** Levenshtein distance between the reported key and this candidate */ + distance: number; +} + /** * Cross-references reported keys against a pool of existing candidate keys and * suggests the closest match when a key looks like a simple typo of another. @@ -50,8 +60,8 @@ export function suggestTypos( function findClosestKey( key: string, candidateKeys: string[], -): { key: string; distance: number } | null { - let best: { key: string; distance: number } | null = null; +): ClosestMatch | null { + let best: ClosestMatch | null = null; for (const candidate of candidateKeys) { if (candidate === key) continue; From b8657f79c2d805c7147b7e52de4a4740cdbf2912 Mon Sep 17 00:00:00 2001 From: Chrilleweb Date: Sat, 15 Aug 2026 09:33:39 +0200 Subject: [PATCH 2/2] chore: comments --- packages/cli/src/core/diffEnv.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/cli/src/core/diffEnv.ts b/packages/cli/src/core/diffEnv.ts index 9f09d982..e5a858c3 100644 --- a/packages/cli/src/core/diffEnv.ts +++ b/packages/cli/src/core/diffEnv.ts @@ -4,10 +4,8 @@ export type DiffResult = { /** Keys present in the example file but missing from the current file */ missing: string[]; - /** Keys present in the current file but not defined in the example file */ extra: string[]; - /** Keys that exist in both files but have mismatched values */ valueMismatches: { /** The environment variable key */