@dsebastien/music-notation 0.26.0 → 0.26.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -192,7 +192,7 @@ Add this to your site's `publish.js`. It loads the bundle only on pages that hav
192
192
 
193
193
  ```js
194
194
  ;(() => {
195
- const VERSION = '0.25.0'
195
+ const VERSION = '0.26.0'
196
196
  const CDN = `https://cdn.jsdelivr.net/npm/@dsebastien/music-notation@${VERSION}/dist`
197
197
  const selector = (languages) => languages.map((l) => `pre > code.language-${l}`).join(', ')
198
198
  const BLOCKS = selector([
package/dist/index.js CHANGED
@@ -95,7 +95,11 @@ function withoutParentheses(suffix) {
95
95
  return null;
96
96
  return suffix.replace(/[(),\s]/g, "");
97
97
  }
98
+ var leadSheetSuffix = (suffix) => suffix.replace(/^(?:mi|MI|min|MIN)(?![A-Za-z])/, "m").replace(/^(?:ma|MA)(?![A-Za-z])/, "maj");
98
99
  function canonicalSuffix(suffix) {
100
+ const lead = leadSheetSuffix(suffix);
101
+ if (lead !== suffix)
102
+ return canonicalSuffix(lead);
99
103
  const direct = CANONICAL.get(suffix);
100
104
  if (direct !== undefined)
101
105
  return direct;
@@ -1523,9 +1527,10 @@ function parseChord(symbol) {
1523
1527
  return null;
1524
1528
  const trimmed = symbol.trim();
1525
1529
  const { root, bass } = parts;
1526
- const suffix = withoutParentheses(parts.suffix);
1530
+ const lead = leadSheetSuffix(parts.suffix);
1531
+ const suffix = withoutParentheses(lead);
1527
1532
  let quality = null;
1528
- for (const written of suffix === null || suffix === parts.suffix ? [parts.suffix] : [parts.suffix, suffix]) {
1533
+ for (const written of suffix === null || suffix === lead ? [lead] : [lead, suffix]) {
1529
1534
  for (const [re, label] of QUALITY_SUFFIXES) {
1530
1535
  const hit = re.exec(written);
1531
1536
  if (hit) {
@@ -18898,5 +18903,5 @@ export {
18898
18903
  withTonicizations
18899
18904
  };
18900
18905
 
18901
- //# debugId=47E914BB1589446C64756E2164756E21
18906
+ //# debugId=A93BDCD6EB2011A264756E2164756E21
18902
18907
  //# sourceMappingURL=index.js.map