![Maintainability](https://api.codeclimate.com/v1/badges/843becfdf91e15da5b0c/maintainability)
kitai (期待)
This is a copy of kotlin's require function.
It validates the condition you give it and if it's false will throw an IllegalArgumentException.
Installation
- npm i -S @pepijn98/kitai
- yarn add @pepijn98/kitai
Examples
See examples for more
import expect from "@pepijn98/kitai";
function test(arg: number): void {
expect(arg >= 0, () => `"arg" cannot be a negative number, was ${arg}`);
}
test(-5);
test(15);
Name
Since it's a Japanese name I guess I should explain this, even though I don't speak Japanese and use translators.
Kitai written as 期待 in kanji, roughly means "Expectations" or "Expectation"
(directly taken from google translate and deepl, please excuse my ignorance if it's completly wrong)