@frauschert/ts-guard

1.0.0 • Public • Published

ts-guard

ts-guard is a typescript library that provides composable type guards. Its inspired by zod but focusses only on type guards and is more lightweight.

Usage

import { isObject, isString, isNumber } from 'ts-guard';

const isPerson = isObject({ name: isString, age: isNumber });
const someValue = ...

if(isPerson(someValue)) {
  /// someValue is Person
}

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

Dependencies (0)

    Dev Dependencies (8)

    Package Sidebar

    Install

    npm i @frauschert/ts-guard

    Weekly Downloads

    1

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    12.7 kB

    Total Files

    48

    Last publish

    Collaborators

    • frauschert