mirror of
https://github.com/aaronsb/obsidian-mcp-plugin.git
synced 2026-07-22 06:45:14 +00:00
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.
This commit is contained in:
parent
c2d6f8b325
commit
767bbd7a49
1 changed files with 4 additions and 4 deletions
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue