@goplayerjuggler/abc-tools 1.0.20 → 1.0.21

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goplayerjuggler/abc-tools",
3
- "version": "1.0.20",
3
+ "version": "1.0.21",
4
4
  "description": "sorting algorithm and implementation for ABC tunes; plus other tools for parsing and manipulating ABC tunes",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -417,7 +417,7 @@ function reconstructMusicFromTokens(tokens) {
417
417
  const token = tokens[i];
418
418
 
419
419
  // Add the token (possibly modified)
420
- result += token.token;
420
+ if (token.token) result += token.token;
421
421
 
422
422
  // Add spacing after token (but not after the last token)
423
423
  if (i < tokens.length - 1 && token.spacing && token.spacing.whitespace) {
@@ -294,11 +294,12 @@ function parseGraceNotes(graceStr) {
294
294
  function parseBrokenRhythm(token) {
295
295
  const brokenMatch = token.match(/^(<{1,3}|>{1,3})$/);
296
296
  if (brokenMatch) {
297
- const symbol = brokenMatch[1];
297
+ const token = brokenMatch[1];
298
298
  return {
299
299
  isBrokenRhythm: true,
300
- direction: symbol[0],
301
- dots: symbol.length
300
+ direction: token[0],
301
+ token,
302
+ dots: token.length
302
303
  };
303
304
  }
304
305
  return null;