Skip to content

Function triggers error if argument is not integer of zero or greater

License

Notifications You must be signed in to change notification settings

writetome51/error-if-not-integer-zero-or-greater

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

import { errorIfNotIntegerZeroOrGreater} from 'error-if-not-integer-zero-or-greater';

About

Function triggers error if argument is not integer of zero or greater

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published