feat: Filemagedon
Some checks failed
Build, check & Test / run (push) Failing after 1m45s
Lint / run (push) Failing after 48s
Build Docker Image / build_docker (push) Failing after 3m18s

Signed-off-by: Avior <git@avior.me>
This commit is contained in:
2024-09-11 14:38:58 +02:00
parent 3e91597dca
commit bc97d9106b
45 changed files with 4548 additions and 64 deletions

25
src/libs/Schema/README.md Normal file
View File

@ -0,0 +1,25 @@
a Full featured and lightweight Schema validation/parsing library
it is meant to be used for input validation
example :
```ts
import Schema, { s, type SchemaInfer } from 'libs/Schema'
const schema = new Schema({
test: s.record(s.string(), s.object({
a: s.number().parseString().min(3, 'a is too small')
}))
})
const t = {
test: {
b: {a: '34'}
}
}
// validate that `t` is coherant with the schema above
const { object, error } = schema.validate(t)
console.log(object, error)
```