0.5.0 • Published 4 years ago

@octod/typeguards v0.5.0

Weekly downloads
1
License
-
Repository
github
Last release
4 years ago

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