Skip to content

Commit 767bbd7

Browse files
committed
refactor(router): drop unused ctx param from pure helpers (PR #203 review nit)
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.
1 parent c2d6f8b commit 767bbd7

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/semantic/operations/vault.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ export async function executeVaultOperation(ctx: RouterContext, action: string,
435435
}
436436

437437
// Split the content
438-
const splitFiles = splitContent(ctx, sourceFile.content, params);
438+
const splitFiles = splitContent(sourceFile.content, params);
439439

440440
// Create output files
441441
const createdFiles = [];
@@ -539,7 +539,7 @@ export async function executeVaultOperation(ctx: RouterContext, action: string,
539539

540540
// Sort files if requested
541541
if (sortBy) {
542-
sortFiles(ctx, sourceFiles, sortBy, sortOrder);
542+
sortFiles(sourceFiles, sortBy, sortOrder);
543543
}
544544

545545
// Combine content
@@ -642,7 +642,7 @@ export async function executeVaultOperation(ctx: RouterContext, action: string,
642642
}
643643
}
644644

645-
function splitContent(ctx: RouterContext, content: string, params: Params): Array<{ content: string }> {
645+
function splitContent(content: string, params: Params): Array<{ content: string }> {
646646
const splitBy = paramStr(params, 'splitBy');
647647
const delimiter = paramStr(params, 'delimiter');
648648
const level = paramNum(params, 'level');
@@ -766,7 +766,7 @@ function splitContent(ctx: RouterContext, content: string, params: Params): Arra
766766
return splitFiles.length > 0 ? splitFiles : [{ content }];
767767
}
768768

769-
function sortFiles(ctx: RouterContext, files: Array<{ path: string; content: string }>, sortBy: string, sortOrder: string): void {
769+
function sortFiles(files: Array<{ path: string; content: string }>, sortBy: string, sortOrder: string): void {
770770
// For file metadata, we'd need to use Obsidian's API
771771
// For now, we'll sort by name and size (which we can calculate)
772772

0 commit comments

Comments
 (0)