Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/writetome51/error-if-not-integer-zero-or-greater
Function triggers error if argument is not integer of zero or greater
https://github.com/writetome51/error-if-not-integer-zero-or-greater
error integer javascript message not type-check
Last synced: about 16 hours ago
JSON representation
Function triggers error if argument is not integer of zero or greater
- Host: GitHub
- URL: https://github.com/writetome51/error-if-not-integer-zero-or-greater
- Owner: writetome51
- License: mit
- Created: 2019-04-07T23:36:15.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-07-30T23:17:33.000Z (over 4 years ago)
- Last Synced: 2024-12-24T02:37:11.953Z (10 days ago)
- Topics: error, integer, javascript, message, not, type-check
- Language: JavaScript
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# errorIfNotIntegerZeroOrGreater(arg): void
In order to not trigger an error, `arg` must be type 'number' and an
integer of 0 or greater.## Examples
```
errorIfNotIntegerZeroOrGreater('1');
// Error: "Input must be a finite number of type 'number' "errorIfNotIntegerZeroOrGreater(0.55);
// Error: "Input must be integer"errorIfNotIntegerZeroOrGreater(-2);
// Error: "Input must be an integer not less than 0"errorIfNotIntegerZeroOrGreater(2); // no error.
```## Installation
`npm i error-if-not-integer-zero-or-greater`## Loading
```js
import { errorIfNotIntegerZeroOrGreater} from 'error-if-not-integer-zero-or-greater';
```