error-if-not-string-longer-than-zero
v1.0.0
Published
Function triggers error if argument is not string longer than zero characters
Downloads
5
Maintainers
Readme
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;