Skip to content

zachlysobey/z-validate

Repository files navigation

z-validate

Actions Status

A simple (TypeScript) library with a set of predicates for simple type validation. Eventually, this will have higher-order predicates, and composable functions.

Usage

NOTE: This is still under construction, and very experimental. That is, not quite ready for use.

Install the library

npm install z-validate

Import it

import * as validators from 'z-validate'

Some examples

string(1) // false

number(1) // true

string('abc') // true

number('abc') // false

Available npm scripts

  • npm test: runs the unit tests
  • npm run test:watch: runs the unit tests in watch-mode
  • npm start: alias for npm run build
  • npm run build: builds the library
  • npm run precommit: runs the tests, formatter, etc. as the git precommit hook would
  • npm run prettier: formats this project's code with 'prettier'

Contributing

See the contributing guide

About

Right now just a collection of composable little predicate functions to be eventually used for a validator

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published