From 48dde4a388fd4c31dd5680f7535419874124e554 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Thu, 25 Jul 2024 16:35:02 -0300 Subject: wip --- src/validators.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/validators.js') diff --git a/src/validators.js b/src/validators.js index 9b34cc04..5300d4ad 100644 --- a/src/validators.js +++ b/src/validators.js @@ -368,9 +368,28 @@ export const isCommentary = caseSensitiveOneShotRegex: commentaryRegexCaseSensitiveOneShot, }); +export function isOldStyleLyrics(content) { + isContentString(content); + + if (/^/m.test(content)) { + throw new TypeError( + `Expected old-style lyrics block not to include at start of any line`); + } + return true; } +export const isLyrics = + anyOf( + isOldStyleLyrics, + validateContentEntries({ + headingPhrase: `lyrics heading`, + entryPhrase: `lyrics entry`, + + caseInsensitiveRegex: commentaryRegexCaseInsensitive, + caseSensitiveOneShotRegex: commentaryRegexCaseSensitiveOneShot, + })); + const isArtistRef = validateReference('artist'); export function validateProperties(spec) { -- cgit 1.3.0-6-gf8a5