typescript omit undefined from union