https://github.com/exbotanical/heuristics
Useful heuristics, type checks, and validation helpers for JavaScript and TypeScript
https://github.com/exbotanical/heuristics
functional-programming type-checking utility-library validation-library
Last synced: 26 days ago
JSON representation
Useful heuristics, type checks, and validation helpers for JavaScript and TypeScript
- Host: GitHub
- URL: https://github.com/exbotanical/heuristics
- Owner: exbotanical
- License: mit
- Created: 2021-10-21T07:38:11.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2023-06-01T11:58:07.000Z (over 2 years ago)
- Last Synced: 2025-02-11T00:43:53.405Z (9 months ago)
- Topics: functional-programming, type-checking, utility-library, validation-library
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/heuristics
- Size: 2.27 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# heuristics
## Useful heuristics, type checks, and validation helpers for JavaScript and TypeScript
[](https://github.com/MatthewZito/heuristics/actions/workflows/cd.yml)
[](https://github.com/MatthewZito/heuristics/actions/workflows/ci.yml)
[](https://coveralls.io/github/MatthewZito/heuristics?branch=master)
[](https://badge.fury.io/js/heuristics)
[](https://opensource.org/licenses/MIT)
`heuristics` is a library of useful heuristics, type checks, and validation helpers for JavaScript and TypeScript. Instead of repeatedly validating types (here, we mean type guards, not annotations), evaluating whether or not an API response is null (or indeed an object, only entirely empty), you can depend on this tested, consistent library API to get the job done.

## Table of Contents
- [Install](#install)
- [Supported Environments](#support)
- [Documentation](#docs)
```bash
npm install heuristics
```
OR
```bash
yarn add heuristics
```
`heuristics` currently supports UMD, CommonJS (node versions >= 10), and ESM build-targets
Commonjs:
```js
const { isDefined } = require('heuristics');
```
ESM:
```js
import { isDefined } from 'heuristics';
```
Full documentation can be found [here](https://matthewzito.github.io/heuristics/heuristics.html)