MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / matchDailyPattern

Function matchDailyPattern

packages/app-core/src/lib/vault-layout.ts:1023–1036  ·  view source on GitHub ↗
(
  subpath: string,
  title: string,
  settings: VaultSettings,
  pattern: DateNotePatternSettings
)

Source from the content-addressed store, hash-verified

1021}
1022
1023function matchDailyPattern(
1024 subpath: string,
1025 title: string,
1026 settings: VaultSettings,
1027 pattern: DateNotePatternSettings
1028): Date | null {
1029 const numerics = patternNumerics(pattern, subpath, title, DEFAULT_DAILY_NOTE_TITLE_PATTERN)
1030 if (!numerics) return null
1031 for (const candidate of dailyCandidateDates(numerics)) {
1032 const expected = dailyNoteLocationForPattern(candidate, settings, pattern)
1033 if (expected.subpath === subpath && expected.title === title) return candidate
1034 }
1035 return null
1036}
1037
1038function matchWeeklyPattern(
1039 subpath: string,

Callers 1

classifyDateNoteFunction · 0.85

Calls 3

patternNumericsFunction · 0.85
dailyCandidateDatesFunction · 0.85

Tested by

no test coverage detected