0.2.0 • Published 7 years ago

structype v0.2.0

Weekly downloads
1
License
MIT
Repository
-
Last release
7 years ago

CircleCI

Install

yarn add structype

Usage

import { Type, String, Number } from 'structype'

export const Person = Type({
  firstName: String,
  lastName: String,
  age: Number
})

export type Person = typeof Person.type

Static Type Inference

function handleInput(obj: any) {
  if (Person.test(obj)) {
    obj // x is a Person
  } else {
    obj // x is still any
  }
}
0.2.0

7 years ago

0.1.8

7 years ago

0.1.7

7 years ago

0.1.6

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.0.1

7 years ago