1.0.5 • Published 2 years ago

delsenyoret v1.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Delsenyoret

Validator utility class (304 bytes).

Install

npm i delsenyoret

Use

import { Validator } from "delsenyoret";

let product_name_validator = new Validator<string>("product")
   .addRule("is_string", value => typeof value === "string")
   .addRule("is_not_empty", value => value.length > 0)
   .addRule("starts_with_pattern", value => value.startsWith("sku-"));

product_name_validator.exec("sku 37db5e2d-c36c-49c0-b8bd-ca750fd9e35a"); // throws
product_name_validator.exec("sku-37db5e2d-c36c-49c0-b8bd-ca750fd9e35a"); // ok

License

Delsenyoret is distributed under the MIT license

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago