Sovereign 8s.is mirror of standardgalactic/leukocyte
  • TypeScript 100%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Jacob Weisenburger 03a521f2c0 changes
2023-08-28 16:25:32 -05:00
.vscode changes 2023-08-25 09:24:22 -05:00
src changes 2023-08-28 16:25:32 -05:00
.gitignore changes 2023-08-25 09:24:22 -05:00
build_npm.ts changes 2023-08-25 11:57:26 -05:00
deno.json changes 2023-08-25 09:24:22 -05:00
deno.lock changes 2023-08-25 11:57:26 -05:00
import_map.json changes 2023-08-25 11:57:26 -05:00
LICENSE changes 2023-08-25 09:24:22 -05:00
logo.svg changes 2023-08-25 09:24:22 -05:00
README copy.md changes 2023-08-25 09:24:22 -05:00
README.md changes 2023-08-25 14:00:26 -05:00

leukocyte

Customizable validation with type inference

Partial credit for the library name leukocyte goes to:

TODO

  • Add tests
  • Add documentation
  • infer optional/nullable prop types no matter where they are in the method chain. Currently, they only work if defined after the type specific methods.
    • I have tried this:
    readonly props: Props & {
        readonly optional: unknown extends Props[ 'optional' ] ? boolean | undefined : Props[ 'optional' ]
        readonly nullable: unknown extends Props[ 'nullable' ] ? boolean | undefined : Props[ 'nullable' ]
    }
    
  • filter out props that are not valid for the baseType