Closed charlesLoder closed 1 year ago
When calling next of prev on a class that extends Node, type safety is lost.
next
prev
Node
new Text("כִּסֵּ֣א").syllables.forEach(s => console.log(s.next.vowelName)); // Property 'vowelName' does not exist on type 'Node'.ts(2339)
You have to as cast as the type.
new Text("כִּסֵּ֣א").syllables.forEach(s => { const next = s.next as Syllable; console.log(next.vowelName); });
This is pretty ugly and annoying.
When calling
next
ofprev
on a class that extendsNode
, type safety is lost.You have to as cast as the type.
This is pretty ugly and annoying.