1.0.0 • Published 5 years ago

error-if-not-string-longer-than-zero v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

errorIfNotStringLongerThanZero(arg): void

Examples

errorIfNotStringLongerThanZero('h'); // no error.

errorIfNotStringLongerThanZero('');
// Error: "Input must be string longer than zero characters"

errorIfNotStringLongerThanZero(false);
// Error: "Input must be string"

Installation

npm i error-if-not-string-longer-than-zero

Loading

// if using TypeScript:
import { errorIfNotStringLongerThanZero } 
    from 'error-if-not-string-longer-than-zero';
// if using ES5 JavaScript:
var errorIfNotStringLongerThanZero = 
    require('error-if-not-string-longer-than-zero')
    .errorIfNotStringLongerThanZero;