While calling next or prev won't get type-safety, now you can call value to get the object of next and prev.
Example:
const str = `כּוֹרֶשׁ כּ֫וֹרֶשׁ`;
const text = new Text(str);
const syllable = text.syllables[0]; // is a Syllable
const next = syllable.next; // no Syllable types, only Node types (i.e. prev, next, siblings)
const nextSyl = next?.value // is a Syllable
console.log(nextSyl?.text); // "רֶשׁ"
Closes #98
While calling
next
orprev
won't get type-safety, now you can callvalue
to get the object ofnext
andprev
.Example: