https://github.com/tamino-martinius/meteor-type-checking
https://github.com/tamino-martinius/meteor-type-checking
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/tamino-martinius/meteor-type-checking
- Owner: tamino-martinius
- License: mit
- Created: 2014-02-22T16:50:22.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2018-04-11T13:32:06.000Z (about 7 years ago)
- Last Synced: 2025-01-06T03:21:56.231Z (4 months ago)
- Language: CoffeeScript
- Size: 6.84 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# type-checking
[](https://travis-ci.org/tamino-martinius/meteor-type-checking)
type-checking for string, number, function and array.
## isNumber
```js
isNumber(0); // true
isNumber(1); // true
isNumber(-1); // true
isNumber(NaN); // true
isNumber(Infinity); // true
isNumber("0"); // false
isNumber("1"); // false
isNumber("-1"); // false
isNumber(null); // false
isNumber(true); // false
isNumber(false); // false
isNumber(undefined); // false
```## isString
```js
isString(""); // true
isString("true"); // true
isString("false"); // true
isString("1"); // true
isString("0"); // true
isString(new String()); // true
isString(new String("")); // true
isString(new String(null)); // true
isString(0); // false
isString(1); // false
isString(-1); // false
isString(null); // false
isString(undefined); // false
```## isFunction
```js
isFunction(->); // true
isFunction(-> false); // true
isFunction(-> true); // true
isFunction(null); // false
isFunction(undefined); // false
```## isArray
```js
isArray([]); // true
isArray(new Array); // true
isArray(null); // false
isArray(undefined); // false
```