https://github.com/vyarmak/check-tool
Simple set of tools to check variables / properties
https://github.com/vyarmak/check-tool
check javascript javascript-library javascript-tools tools
Last synced: 4 months ago
JSON representation
Simple set of tools to check variables / properties
- Host: GitHub
- URL: https://github.com/vyarmak/check-tool
- Owner: vyarmak
- License: mit
- Created: 2017-06-24T01:58:25.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2018-03-06T00:53:17.000Z (over 8 years ago)
- Last Synced: 2025-07-03T20:03:52.052Z (12 months ago)
- Topics: check, javascript, javascript-library, javascript-tools, tools
- Language: JavaScript
- Size: 15.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# check-tool [](https://travis-ci.org/vyarmak/check-tool)
Tired of passing it from project to project - put this simple set of functions to check variables into a package. Includes check of undefined / defined / defined and not null / defined and not empty / is number / is function is object
# Install
```
$ npm install check-tool
```
# Usage
```js
var checkTool = require('check-tool')
if (checkTool.isDefined(varaiable)) {
// do something...
}
if (checkTool.isNotNull(varaiable)) {
// do something...
}
if (checkTool.isNotEmpty(varaiable)) {
// do something...
}
if (checkTool.isEmpty(varaiable)) {
// do something...
}
if (checkTool.isNotNaN(varaiable)) {
// do something...
}
if (checkTool.isObject(varaiable)) {
// do something...
}
if (checkTool.isFunction(varaiable)) {
// do something...
}
if (checkTool.isNumber(varaiable)) {
// do something...
}
```