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

    Function emptyAsUndefined

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

      Type Parameters

      • E

      Parameters

      • Optionalarray: null | E[]

        The arrays to inspect

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

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

      David Hsing

      emptyAsUndefined(['foo', 'bar']);    // ['foo', 'bar']
      emptyAsUndefined(['foo', '']); // ['foo', undefined]
      emptyAsUndefined(['', 'bar']); // [undefined, 'bar']