Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/itsjonq/is
💡 A tiny type checker for JavaScript
https://github.com/itsjonq/is
check check-type checker is javascript plain-object tiny type type-check type-checker types
Last synced: about 1 month ago
JSON representation
💡 A tiny type checker for JavaScript
- Host: GitHub
- URL: https://github.com/itsjonq/is
- Owner: ItsJonQ
- License: mit
- Created: 2019-12-01T00:10:56.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-03-05T10:34:30.000Z (almost 2 years ago)
- Last Synced: 2024-10-28T22:40:44.726Z (about 2 months ago)
- Topics: check, check-type, checker, is, javascript, plain-object, tiny, type, type-check, type-checker, types
- Language: JavaScript
- Homepage:
- Size: 4.42 MB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 22
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 💡 is
[![Build Status](https://travis-ci.org/ItsJonQ/is.svg?branch=master)](https://travis-ci.org/ItsJonQ/is)
[![codecov](https://codecov.io/gh/ItsJonQ/is/branch/master/graph/badge.svg)](https://codecov.io/gh/ItsJonQ/is)
[![Bundle size](https://badgen.net/bundlephobia/minzip/@itsjonq/is)](https://bundlephobia.com/result?p=@itsjonq/is)> A tiny type checker
`is` is a simple sub 400B type checking library for JavaScript.
For a more feature-packed version, check out [@sindresorhus/is](https://github.com/sindresorhus/is).## Table of Contents
- [Installation](#installation)
- [Usage](#usage)
- [Supported types](#supported-types)## Installation
```
npm install @itsjonq/is
```## Usage
```js
import is from '@itsjonq/is';is.string('Hello');
// trueconst fn = () => 'Nope';
is.string(fn);
// false
is.function(fn);
// true
is.object(fn);
// true
is.plainObject(fn);
// false
```### Supported types
- `is.array`
- `is.blob`
- `is.boolean`
- `is.defined`
- `is.file`
- `is.function`
- `is.map`
- `is.null`
- `is.number`
- `is.object`
- `is.plainObject`
- `is.regExp`
- `is.string`
- `is.symbol`
- `is.undefined`
- `is.weakMap`