From efe8e13267d7c3167e78b9a02ac94f6f801fc19e Mon Sep 17 00:00:00 2001 From: SebastianMC <23032356+SebastianMC@users.noreply.github.com> Date: Thu, 5 Sep 2024 20:01:11 +0200 Subject: [PATCH] #156 - improved support for index-note-based folder notes - fresh head review - typos correction - comment updates for clarity --- src/custom-sort/custom-sort.ts | 2 +- src/test/unit/utils.spec.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/custom-sort/custom-sort.ts b/src/custom-sort/custom-sort.ts index dc4bb9f..d320f56 100644 --- a/src/custom-sort/custom-sort.ts +++ b/src/custom-sort/custom-sort.ts @@ -476,7 +476,7 @@ export const determineSortingGroup = function (entry: TFile | TFolder, spec: Cus case CustomSortGroupType.HasMetadataField: if (group.withMetadataFieldName) { if (ctx?._mCache) { - // For folders - scan metadata of 'folder note' in same-name-as-folder mode + // For folders - scan metadata of 'folder note' in same-name-as-parent-folder mode const notePathToScan: string = aFile ? entry.path : `${entry.path}/${entry.name}.md` let frontMatterCache: FrontMatterCache | undefined = ctx._mCache.getCache(notePathToScan)?.frontmatter let hasMetadata: boolean | undefined = frontMatterCache?.hasOwnProperty(group.withMetadataFieldName) diff --git a/src/test/unit/utils.spec.ts b/src/test/unit/utils.spec.ts index 1f65045..2a60bcb 100644 --- a/src/test/unit/utils.spec.ts +++ b/src/test/unit/utils.spec.ts @@ -27,7 +27,7 @@ describe('lastPathComponent and extractParentFolderPath', () => { ) }) -describe('extractBasenane', () => { +describe('extractBasename', () => { const params: Array<(string|undefined)[]> = [ // Obvious ['index', 'index'], @@ -39,7 +39,7 @@ describe('extractBasenane', () => { ['.md',''], ['.md.md','.md'] ]; - it.each(params)('>%s< should become %s', (s: string|undefined, out: string|undefined) => { + it.each(params)('>%s< should result in %s', (s: string|undefined, out: string|undefined) => { expect(extractBasename(s)).toBe(out) }) })