HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux wordpress-ubuntu-s-2vcpu-4gb-fra1-01 5.4.0-169-generic #187-Ubuntu SMP Thu Nov 23 14:52:28 UTC 2023 x86_64
User: root (0)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/zaklada/html/node_modules/simple-is/README.md
# simple-is.js
A maximally minimal type-testing library. Use it to make your code
more readable. Works in node and browsers.



## Usage
`var is = require("simple-is");`

Use `is.number(x)` instead of `typeof x === "number"` (also `is.boolean`, `is.string`, `is.fn`).

Use `is.nan(x)` instead of `typeof x === "number" && isNaN(x)`, `x !== x` or ES6 `Number.isNaN(x)`.

Use `is.object(x)` instead of `x !== null && typeof x === "object"`.

Use `is.primitive(x)` instead of `x === null || x === undefined || typeof x === "boolean" || typeof x === "number" || typeof x === "string"` (verbose on purpose).

Use `is.array(x)` instead of ES5 `Array.isArray`.

Use `is.finitenumber(x)` instead of `typeof x === "number" && isFinite(x)` or ES6 `Number.isFinite(x)`.

Use `is.someof(x, ["first", 2, obj])` instead of (usually) `x === "first" || x === 2 || x === obj` or (alternatively)  `["first", 2, obj].indexOf(x) >= 0`. Great for reducing copy and paste mistake in `if`-conditions and for making them more readable.

Use `is.noneof(x, ["first", 2, obj])` instead of (usually) `x !== "first" && x !== 2 && x !== obj` or (alternatively)  `["first", 2, obj].indexOf(x) === -1`.

Use `is.own(x, "name")` instead of `Object.prototype.hasOwnProperty.call(x, "name")`.

That's it.



## Installation

### Node
Install using npm

    npm install simple-is

```javascript
var is = require("simple-is");
```

### Browser
Clone the repo and include it in a script tag

    git clone https://github.com/olov/simple-is.git

```html
<script src="simple-is/simple-is.js"></script>
```