Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ajimae/isnumber

a deno module to check if a given value or variable is a number
https://github.com/ajimae/isnumber

Last synced: 19 days ago
JSON representation

a deno module to check if a given value or variable is a number

Awesome Lists containing this project

README

        

# 🦕 Deno isNumber

## Usage

```typescript
import { isNumber } from "https://raw.githubusercontent.com/ajimae/isNumber/master/mod.ts";

var numberOne = 5;
const checkOne = isNumber(numberOne);
console.log(checkOne); // true

var numberTwo = '5';
const checkTwo = isNumber(numberTwo);
console.log(checkTwo); // false
```

## Test

```bash
# unit tests - first clone this repo to your local machine the run
deno test
```

## Resources

JavaScript
- [JavaScript isNaN](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/isNaN)
- [JavaScript typof](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof)

Deno
- [Deno Website](https://deno.land)
- [Deno documentation](https://doc.deno.land/https/github.com/denoland/deno/releases/latest/download/lib.deno.d.ts)
- [Deno Standard Library](https://deno.land/std)