Skip to content

Instantly share code, notes, and snippets.

@blemoine
Created March 31, 2018 20:36
Show Gist options
  • Save blemoine/f022a10fb78a8faf93544442abadf335 to your computer and use it in GitHub Desktop.
Save blemoine/f022a10fb78a8faf93544442abadf335 to your computer and use it in GitHub Desktop.
class PositiveNumber {
constructor(public value: number) {
if (value < 0) {
throw new Error("The number must be positive");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment