Skip to content

Commit

Permalink
Merge pull request #264 from cuthbertLab/tinynotation_typing
Browse files Browse the repository at this point in the history
Small type improvements to TinyNotation
  • Loading branch information
mscuthbert authored Nov 16, 2024
2 parents b1a221d + 1235d03 commit 54b2ca6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/tinyNotation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import * as tie from './tie';
/**
* Regular expressions object
*/
const regularExpressions: { [k: string]: RegExp } = {
export const regularExpressions: { [k: string]: RegExp } = {
REST: /r/,
OCTAVE2: /([A-G])[A-G]+/,
OCTAVE3: /([A-G])/,
Expand All @@ -33,7 +33,7 @@ const regularExpressions: { [k: string]: RegExp } = {
NAT: /^[A-Ga-g]+'*n/, // explicit naturals
TYPE: /(\d+)/,
TIE: /.~/, // not preceding ties
PRECTIE: /~/, // front ties
PRECTIE: /~/, // front ties // TODO: remove these...
ID_EL: /=([A-Za-z0-9]*)/,
LYRIC: /_(.*)/,
DOT: /\.+/,
Expand Down Expand Up @@ -72,7 +72,7 @@ export function TinyNotation(textIn: string): stream.Part|stream.Score {
textIn = textIn.slice(14);
}

const tokens: string[] = textIn.split(' ');
const tokens: string[] = textIn.split(/\s+/);

let optionalScore: stream.Score;

Expand Down Expand Up @@ -110,7 +110,7 @@ export function TinyNotation(textIn: string): stream.Part|stream.Score {
p.append(m);
m = new stream.Measure();
}
if (optionalScore === undefined) {
if (!optionalScore) {
optionalScore = new stream.Score();
}
optionalScore.insert(0, p);
Expand Down

0 comments on commit 54b2ca6

Please sign in to comment.