Skip to content

Commit 8dd145e

Browse files
committed
Make fixEnglishKeyNames directly part of runPostProcess
This will be needed for easy flow typing, plus flow no longer allows this inside objects.
1 parent 3ef6a9d commit 8dd145e

File tree

1 file changed

+13
-17
lines changed

1 file changed

+13
-17
lines changed

root/static/scripts/guess-case/modes.js

+13-17
Original file line numberDiff line numberDiff line change
@@ -296,22 +296,6 @@ export const English = {
296296
},
297297
)),
298298

299-
/*
300-
* This changes key names in titles to follow
301-
* the English classical music guidelines.
302-
* See https://musicbrainz.org/doc/Style/Classical/Language/English#Keys
303-
*/
304-
fixEnglishKeyNames(is) {
305-
return is.replace(
306-
/\bin ([a-g])(?:[\s-]([Ff]lat|[Ss]harp))?\s(dorian|lydian|major|minor|mixolydian)(?:\b|$)/ig,
307-
function (match, p1, p2, p3) {
308-
return 'in ' + p1.toUpperCase() +
309-
(p2 ? '-' + p2.toLowerCase() : '') +
310-
' ' + p3.toLowerCase();
311-
},
312-
);
313-
},
314-
315299
isSentenceCaps() {
316300
return false;
317301
},
@@ -320,7 +304,19 @@ export const English = {
320304

321305
runPostProcess(is) {
322306
is = DefaultMode.runPostProcess(is);
323-
is = this.fixEnglishKeyNames(is);
307+
/*
308+
* This changes key names in titles to follow
309+
* the English classical music guidelines.
310+
* See https://musicbrainz.org/doc/Style/Classical/Language/English#Keys
311+
*/
312+
is = is.replace(
313+
/\bin ([a-g])(?:[\s-]([Ff]lat|[Ss]harp))?\s(dorian|lydian|major|minor|mixolydian)(?:\b|$)/ig,
314+
function (match, p1, p2, p3) {
315+
return 'in ' + p1.toUpperCase() +
316+
(p2 ? '-' + p2.toLowerCase() : '') +
317+
' ' + p3.toLowerCase();
318+
},
319+
);
324320
return is;
325321
},
326322
};

0 commit comments

Comments
 (0)