@ryandur/sand
    Preparing search index...

    Function notEmpty

    • A value that is not empty.

      Type Parameters

      • T

      Parameters

      • value: T | null | undefined

      Returns value is T

      test for has

      Example:

      notEmpty({}) // produces: false
      notEmpty({I: 'am not empty'}) // produces: true

      notEmpty([]) // produces: false
      notEmpty([1, 2, 3]) // produces: true

      notEmpty('') // produces: false
      notEmpty('not empty') // produces: true

      notEmpty(NaN) // produces: false
      notEmpty(0) // produces: true

      A false result does not prove absence: '' and [] and {} are present but empty, yet the negative branch narrows as though the value were null or undefined. Guard with has/notEmpty when you want substance; compare against undefined when you only care about presence.