@octod/typeguards
TypeScript icon, indicating that this package has built-in type declarations

0.5.0 • Public • Published

typeguards

Everyday use typeguards for your JavaScript and TypeScript codebase

🎉 Features

This library grants you a list of typeguards functions to check if certain data are of a certain type

Install

# npm
npm i @octod/typeguards

# yarn
yarn add @octod/typeguards

📖 Docs

You can read docs here, just remember to run your npm run docs script.

🔍 Usage

// maybe-a-hello-world.ts

export default function maybeAnHelloWorld() {
  console.log('hello world');
}

// app.ts
import * as guards from 'typeguards';
import maybeAnHelloWorld from './maybe-a-hello-world';

if (guards.isFunction(maybeAnHelloWorld)) {
  maybeAnHelloWorld(); // logs hello world
}

❤️ Contributing

Every contribution is really welcome!

If you feel that something can be improved or should be fixed, feel free to open an issue with the feature or the bug found.

If you want to fork and open a pull request (adding features or fixes), feel free to do it. Remember only to use the dev branch as a base.

Read the contributing guidelines

📃 Licence

Read the licence

/@octod/typeguards/

    Package Sidebar

    Install

    npm i @octod/typeguards

    Weekly Downloads

    0

    Version

    0.5.0

    License

    none

    Unpacked Size

    33.2 kB

    Total Files

    13

    Last publish

    Collaborators

    • octod