For clarity and consistency I suggest that note === [noteSegment, ...]. A "note" should always be an array of one or more note segments. A note segment is a a vFocus on a <gu-note> tag.
At the moment there's some ambiguity around this. findFirstNote for example checks whether a vFocus is a note segment (would be better named as findFirstNoteSegment). findAllNotes get is right: it returns an array of notes (where each note is an array of note segments).
I went through the utility functions and checked whether they're correct in this sense or should be renamed:
findAllNotes - correct
findEntireNote - correct
findFirstNote -> findFirstNoteSegmentfindLastNote -> findLastNoteSegmentfindNoteById - correct
findParentNote -> findParentNoteSegmentfindSelectedNote - correct
isNotWithinNote - correct
isNote -> isNoteSegmentisWithinNote - correct
For clarity and consistency I suggest that
note === [noteSegment, ...]
. A "note" should always be an array of one or more note segments. A note segment is a a vFocus on a<gu-note>
tag.At the moment there's some ambiguity around this.
findFirstNote
for example checks whether a vFocus is a note segment (would be better named asfindFirstNoteSegment
).findAllNotes
get is right: it returns an array of notes (where each note is an array of note segments).I went through the utility functions and checked whether they're correct in this sense or should be renamed:
findAllNotes
- correctfindEntireNote
- correctfindFirstNote
->findFirstNoteSegment
findLastNote
->findLastNoteSegment
findNoteById
- correctfindParentNote
->findParentNoteSegment
findSelectedNote
- correctisNotWithinNote
- correctisNote
->isNoteSegment
isWithinNote
- correct