utils

@cahil/utilsGlobalsvalidation

External module: validation

Index

Functions

Functions

isNonEmptyString

isNonEmptyString(text: string): boolean

Defined in src/validation/isNonEmptyString.ts:20

Checks if a value provided is of type string and has a non-zero length. If the value is not a string or it is an empty string then the function returns false

example


const valid = isNonEmptyString('hello') // => true

Parameters:

Name Type Description
text string The text to validate

Returns: boolean

True if the value is an empty string, false otherwise