Skip to main content

existsAndNotEmpty

Stentor API Reference


Stentor API Reference / stentor-utils/src / existsAndNotEmpty

Function: existsAndNotEmpty()

existsAndNotEmpty\<T>(items): boolean

Defined in: packages/stentor-utils/src/array.ts:70

Quick function to see if the array exists and has a length greater than 0.

You would use this instead of writing myArray && myArray.length > 0, which increases your cyclomatic complexity.

Type Parameters​

T​

T

Parameters​

items​

T[]

Returns​

boolean