@unikue/ts-lang-utils
    Preparing search index...

    Function emptyAsNull

    • Returns a array that replaced the empty element to null from the given array

      Type Parameters

      • E

      Parameters

      • Optionalarray: E[] | null

        The arrays to inspect

      Returns (E | null)[] | null | undefined

      a array that replaced the empty element to null from the given array

      David Hsing

      emptyAsNull(['foo', 'bar']);    // ['foo', 'bar']
      emptyAsNull(['foo', '']); // ['foo', null]
      emptyAsNull(['', 'bar']); // [null, 'bar']