MCPcopy Index your code
hub / github.com/ZenNotes/zennotes / normalizeWeeklyNoteLegacyPatterns

Function normalizeWeeklyNoteLegacyPatterns

apps/server/internal/vault/vault.go:371–388  ·  view source on GitHub ↗
(value []DateNotePatternSettings)

Source from the content-addressed store, hash-verified

369}
370
371func normalizeWeeklyNoteLegacyPatterns(value []DateNotePatternSettings) []DateNotePatternSettings {
372 out := []DateNotePatternSettings{}
373 seen := map[string]bool{}
374 for _, pattern := range value {
375 next := DateNotePatternSettings{
376 Directory: normalizeWeeklyNotesDirectory(pattern.Directory),
377 TitlePattern: normalizeWeeklyNoteTitlePattern(pattern.TitlePattern),
378 Locale: normalizeWeeklyNoteLocale(pattern.Locale),
379 }
380 key := next.Directory + "\x00" + next.TitlePattern + "\x00" + next.Locale
381 if seen[key] {
382 continue
383 }
384 seen[key] = true
385 out = append(out, next)
386 }
387 return out
388}
389
390func normalizePrimaryNotesLocation(value PrimaryNotesLocation) PrimaryNotesLocation {
391 if value == PrimaryNotesRoot {

Callers 1

normalizeVaultSettingsFunction · 0.70

Calls 4

appendFunction · 0.85

Tested by

no test coverage detected