#156 - improved support for index-note-based folder notes - fresh head review

- typos correction
- comment updates for clarity
This commit is contained in:
SebastianMC 2024-09-05 20:01:11 +02:00
parent 60a60dfb72
commit efe8e13267
2 changed files with 3 additions and 3 deletions

View File

@ -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)

View File

@ -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)
})
})