# basic-data-handling

> package contains functions that simply check if the passed argument meets a data type requirement

Latest version **2.0.0** (published 2019-03-14) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install basic-data-handling
pnpm add basic-data-handling
yarn add basic-data-handling
bun add basic-data-handling
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2019-03-14 |
| First published | 2018-09-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 26.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Steve Thompson |
| Maintainers | writetome51 |
| Keywords | basic, type-checking, strict, type, check, data-type, functions, typescript |

## Links

- npm: https://www.npmjs.com/package/basic-data-handling
- Repository: https://github.com/writetome51/basic-data-handling
- Homepage: https://github.com/writetome51/basic-data-handling#readme
- Issues: https://github.com/writetome51/basic-data-handling/issues
- npm.io page: https://npm.io/package/basic-data-handling

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 2.0.0 (latest) — 2019-03-14
- 1.0.15 — 2019-02-20
- 1.0.14 — 2019-02-14
- 1.0.13 — 2018-10-28
- 1.0.12 — 2018-10-07
- 1.0.11 — 2018-10-07
- 1.0.10 — 2018-10-01
- 1.0.9 — 2018-09-29
- 1.0.8 — 2018-09-23
- 1.0.7 — 2018-09-19
- 1.0.6 — 2018-09-16
- 1.0.5 — 2018-09-16
- 1.0.4 — 2018-09-14
- 1.0.3 — 2018-09-14
- 1.0.2 — 2018-09-14
- … 1 more at https://npm.io/package/basic-data-handling/versions

## README

# basic-data-handling

This package contains functions that simply check if the passed argument meets a  
data type requirement.

## To use any one of the functions below...  

<b>If using TypeScript</b>, include the function's import statement  
(commented below each function).  

<b>If using plain JavaScript</b>, turn that 'import' statement into a  
'require' statement like so:
```
import {functionName} from 'basic-data-handling/fileContainingFunction'  

becomes this:

var functionName = require('basic-data-handling/fileContainingFunction').functionName;
```

## Functions that throw Error if `arg` is not <br>required type (they all return void)

checkTypeOf(arg, expectedType)  
`// Performs typeof check on arg.  If arg is not expectedType, throws Error.`  
`// import {checkTypeOf} from 'basic-data-handling/checkTypeOf' `

errorIfNotArray(arg)  
`// import {errorIfNotArray} from 'basic-data-handling/errorIfNotArray' `

errorIfNotBoolean(arg)  
`// import {errorIfNotBoolean} from 'basic-data-handling/errorIfNotBoolean' `

errorIfNotDefined(arg)  
`// errors if arg is undefined or null.`  
`// import {errorIfNotDefined} from 'basic-data-handling/errorIfNotDefined' `

errorIfNotFloat(arg)  
`// import {errorIfNotFloat} from 'basic-data-handling/errorIfNotFloat' `

errorIfNotFunction(arg)  
`// import {errorIfNotFunction} from 'basic-data-handling/errorIfNotFunction' `

errorIfNotInteger(arg)  
`// import {errorIfNotInteger} from 'basic-data-handling/errorIfNotInteger' `

errorIfNotIntegerZeroOrGreater(arg)  
`// import {errorIfNotIntegerZeroOrGreater} from 'basic-data-handling/errorIfNotIntegerZeroOrGreater' `

errorIfNotNumber(arg)  
`// errors if arg is not finite number.`  
`// import {errorIfNotNumber} from 'basic-data-handling/errorIfNotNumber' `

errorIfNotObject(arg)   
`// errors if arg is string, boolean, number, function, null, or undefined.`  
`// import {errorIfNotObject} from 'basic-data-handling/errorIfNotObject' `

errorIfNotPrimitive(arg)   
`// import {errorIfNotPrimitive} from 'basic-data-handling/errorIfNotPrimitive' `

errorIfNotString(arg)  
`// import {errorIfNotString} from 'basic-data-handling/errorIfNotString' `


## Functions that return boolean

isArray(arg)  
`// import {isArray} from 'basic-data-handling/isArray_notArray' `

notArray(arg)  
`// import {notArray} from 'basic-data-handling/isArray_notArray' `

isObject(arg)  
`// Arrays ARE considered objects. `   
`// Does NOT consider null an object. `  
`// Does NOT consider functions objects. `    
`// import {isObject} from 'basic-data-handling/isObject_notObject' `

notObject(arg)  
`// Returns true if arg is string, boolean, number, function, null, or undefined.`   
`// import {notObject} from 'basic-data-handling/isObject_notObject' `

isString(arg)  
`// import {isString} from 'basic-data-handling/isString_notString' `

notString(arg)  
`// import {notString} from 'basic-data-handling/isString_notString' `

isFiniteNumber(arg)  
`// import {isFiniteNumber} from 'basic-data-handling/isFiniteNumber' `

notFiniteNumber(arg)  
`// import {notFiniteNumber} from 'basic-data-handling/isFiniteNumber' `

isInteger(arg)  
`// import {isInteger} from 'basic-data-handling/isInteger_isFloat' `

notInteger(arg)   
`// import {notInteger} from 'basic-data-handling/isInteger_isFloat' `

isFloat(arg)   
`// import {isFloat} from 'basic-data-handling/isInteger_isFloat' `

isEmpty(arrayOrString)   
`// import {isEmpty} from 'basic-data-handling/isEmpty_notEmpty' `

notEmpty(arrayOrString)  
`// import {notEmpty} from 'basic-data-handling/isEmpty_notEmpty' `

isDefined(arg)  
`// returns true if arg is not undefined or null.`  
`// import {isDefined} from  'basic-data-handling/isDefined_notDefined' `

notDefined(arg)  
`// returns true if arg is undefined or null.`  
`// import {notDefined} from 'basic-data-handling/isDefined_notDefined' `


## Installation
`npm i  basic-data-handling`

---
_Source: https://npm.io/package/basic-data-handling · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
