samchungy/pure-parse

Strongly typed validation library that decouples type aliases from validation logic ๐Ÿ’ง

โ˜… 0Forks 0GitHub โ†—Compare

Project website โ†—

README

PureParse logo

PureParse

Typesafe, lightweight parsers

Strongly typed validation library that decouples type aliases from validation logic

Documentation

Tests CI stats License Created by Johannes Lindgren

Declare the type:

type User = {
  id: number
  name: string
}

const parseUser = object<User>({
  id: parseNumber,
  name: parseString,
})

...or infer the type:

const parseUser = object({
  id: parseNumber,
  name: parseString,
})

type User = Infer<typeof parseUser>


Contributors

johannes-lindgren

Issues