1.0.14 • Published 10 months ago

isnt-number v1.0.14

Weekly downloads
-
License
ISC
Repository
github
Last release
10 months ago

isNotNumber

A npm package that gives you a function that returns true if the input is not a number. It's a new approach for everyone who thinks differently!

Installation

You can install the package via npm:

npm install isnt-number

Usage

JavaScript

Here's how to use isnt-number in a JavaScript file:

const { isNotNumber, isEmojiNotNumber, isNotNumberEmoji } = require("isnt-number");

console.log(isNotNumber("hello")); // true
console.log(isNotNumber(123)); // false
console.log(!isNotNumber(123)); // true, like isNumber >.<
console.log(isNotNumber(NaN)); // true

console.log(isEmojiNotNumber("A")); // true
console.log(isEmojiNotNumber("①")); // false
console.log(isEmojiNotNumber("1️⃣")); // false

console.log(isNotNumberEmoji("hello")); // `🙂` 
console.log(isNotNumberEmoji(1)); //  `🙁`

TypeScript

To use isnt-number in a TypeScript file, follow these steps:

  1. Install the package:

    npm install isnt-number
  2. Install the type definitions:

    npm install --save-dev @types/isnt-number
  3. Use the functions in your TypeScript code:

import { isNotNumber, isEmojiNotNumber, isNotNumberEmoji} from "isnt-number";

console.log(isNotNumber("hello")); // true
console.log(isNotNumber(123)); // false
console.log(!isNotNumber(123)); // true, like isNumber >.<
console.log(isNotNumber(NaN)); // true

console.log(isEmojiNotNumber("A")); // true
console.log(isEmojiNotNumber("①")); // false
console.log(isEmojiNotNumber("1️⃣")); // false

console.log(isNotNumberEmoji("hello")); // `🙂` 
console.log(isNotNumberEmoji(1)); //  `🙁`

API

isntNumber(value: any): boolean

  • value: The value to check.
  • Returns: true if the value is not a number, otherwise false.

isEmojiNotNumber(value: any): boolean

  • value: The value to check.
  • Returns: true if the value is not a number emoji, otherwise false.

isNotNumberEmoji(value: any): string

  • value: The value to check.
  • Returns: 🙂 if the value is not a number, otherwise 🙁.

Number Emojis

The isEmojiNotNumber function checks for the following types of number emojis:

  • Circled numbers (1-20): ① ② ③ etc.
  • Negative circled numbers (1-20): ⓿ ❶ ❷ etc.
  • Filled circled numbers (1-10): ➀ ➁ ➂ etc.
  • Keycap numbers (0-9): 0️⃣ 1️⃣ 2️⃣ etc.

Any character that is not one of these number emojis will return true.

License

This project is licensed under the MIT License.

1.0.14

10 months ago

1.0.13

10 months ago

1.0.12

10 months ago

1.0.11

10 months ago

1.0.10

10 months ago

1.0.9

10 months ago

1.0.8

10 months ago

1.0.7

10 months ago

1.0.6

10 months ago

1.0.5

10 months ago

1.0.4

10 months ago

1.0.3

10 months ago

1.0.2

10 months ago

1.0.1

10 months ago

1.0.0

10 months ago