Package Exports
- @octod/typeguards
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@octod/typeguards) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
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