Collapse Terce/Sext/None's identical hymn resolution into one helper

Terce, Sext, and None each had a byte-identical 'hymn' case
(resolveCommon(part.textRef.id), no doxology mechanism, no override/
season tiering). Replace all three with a single shared
resolveSelfContainedHymn helper in resolve-common.ts.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F25189JqjXddUhU9hM9nUS
This commit is contained in:
2026-08-24 07:14:19 -04:00
parent 449472d5aa
commit 72033221c3
4 changed files with 16 additions and 7 deletions
+10 -1
View File
@@ -1,4 +1,4 @@
import type { ResolvedPart, ResolvedText } from './types';
import type { PropersRef, ResolvedPart, ResolvedText } from './types';
import type { Commemoration, DayWinner, LiturgicalDay, Weekday } from '../calendar/types';
import type { ProperText } from '../propers';
import { getCommonProper, getTemporalProper } from '../propers';
@@ -31,6 +31,15 @@ export function resolveCommon(id: string): ResolvedText {
return toResolvedText(getCommonProper(id));
}
/** Terce/Sext/None's own Matins-less hymn 'hymn' case — a plain, fixed,
* self-contained text with no doxology mechanism at all (the closing
* doxology is baked directly into each hour's own hymn text file; see
* {terce,sext,none}-hymn.yml) and no override/season tiering. Byte-
* identical across all three files before being centralized here. */
export function resolveSelfContainedHymn(part: { textRef: PropersRef }): ResolvedPart[] {
return [{ kind: 'hymn', text: resolveCommon(part.textRef.id) }];
}
// Named temporal winners with real standing of their own, unconditionally
// override-eligible — see hours/lauds.ts's getPsalmodyOverrideFor, which
// shares this set (imported from here, not duplicated) since it's the