@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: null | E[]

        The arrays to inspect

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

      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']