Create a number brand with min/max bounds
const Percentage = BoundedNumber("Percentage", 0, 100)const valid = Percentage.of(75) // Some(Brand<"Percentage", number>)const invalid = Percentage.of(150) // None Copy
const Percentage = BoundedNumber("Percentage", 0, 100)const valid = Percentage.of(75) // Some(Brand<"Percentage", number>)const invalid = Percentage.of(150) // None
const Port = BoundedNumber("Port", 1, 65535)const httpPort = Port.unsafeOf(80) // Brand<"Port", number>// Port.unsafeOf(70000) // throws Error Copy
const Port = BoundedNumber("Port", 1, 65535)const httpPort = Port.unsafeOf(80) // Brand<"Port", number>// Port.unsafeOf(70000) // throws Error
Create a number brand with min/max bounds