1.0.14 • Published 9 months ago

isnt-number v1.0.14

Weekly downloads
-
License
ISC
Repository
github
Last release
9 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

9 months ago

1.0.13

9 months ago

1.0.12

9 months ago

1.0.11

9 months ago

1.0.10

9 months ago

1.0.9

9 months ago

1.0.8

9 months ago

1.0.7

9 months ago

1.0.6

9 months ago

1.0.5

9 months ago

1.0.4

9 months ago

1.0.3

9 months ago

1.0.2

9 months ago

1.0.1

9 months ago

1.0.0

9 months ago