From 767bbd7a4939e1c5cfc4aab90fbe080e616001b9 Mon Sep 17 00:00:00 2001 From: Aaron Bockelie Date: Mon, 18 May 2026 23:14:12 -0500 Subject: [PATCH] refactor(router): drop unused ctx param from pure helpers (PR #203 review nit) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit splitContent/sortFiles don't touch RouterContext — the uniform ctx-first param was a mechanical-extraction artifact. Removed from both defs and their two call sites. Indentation nit deliberately NOT addressed: the retained class-method indentation is what makes the extraction a byte-verifiable behaviour-preserving move (per the review's normalized diff); reflowing would destroy that property for zero functional gain. tsc clean, lint baseline, 235/235. --- src/semantic/operations/vault.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/semantic/operations/vault.ts b/src/semantic/operations/vault.ts index e04b60c..63b98a8 100644 --- a/src/semantic/operations/vault.ts +++ b/src/semantic/operations/vault.ts @@ -435,7 +435,7 @@ export async function executeVaultOperation(ctx: RouterContext, action: string, } // Split the content - const splitFiles = splitContent(ctx, sourceFile.content, params); + const splitFiles = splitContent(sourceFile.content, params); // Create output files const createdFiles = []; @@ -539,7 +539,7 @@ export async function executeVaultOperation(ctx: RouterContext, action: string, // Sort files if requested if (sortBy) { - sortFiles(ctx, sourceFiles, sortBy, sortOrder); + sortFiles(sourceFiles, sortBy, sortOrder); } // Combine content @@ -642,7 +642,7 @@ export async function executeVaultOperation(ctx: RouterContext, action: string, } } -function splitContent(ctx: RouterContext, content: string, params: Params): Array<{ content: string }> { +function splitContent(content: string, params: Params): Array<{ content: string }> { const splitBy = paramStr(params, 'splitBy'); const delimiter = paramStr(params, 'delimiter'); const level = paramNum(params, 'level'); @@ -766,7 +766,7 @@ function splitContent(ctx: RouterContext, content: string, params: Params): Arra return splitFiles.length > 0 ? splitFiles : [{ content }]; } -function sortFiles(ctx: RouterContext, files: Array<{ path: string; content: string }>, sortBy: string, sortOrder: string): void { +function sortFiles(files: Array<{ path: string; content: string }>, sortBy: string, sortOrder: string): void { // For file metadata, we'd need to use Obsidian's API // For now, we'll sort by name and size (which we can calculate)