Is there a way to create a type that ensures each character is either '1' or '0' in JavaScript?
type Binary = '1'|'0'
The current type works for single characters only. Is it possible to create a type for repeating patterns of '1' and '0' characters?
Furthermore, I am interested in enforcing a specific length. The following implementation is all I could come up with:
type BinaryInput = `${Binary}${Binary}${Binary}${Binary}${Binary}`;