/** * Copyright 2022 Gravwell, Inc. All rights reserved. * * Contact: [legal@gravwell.io](mailto:legal@gravwell.io) * * This software may be modified and distributed under the terms of the MIT * license. See the LICENSE file for details. */ import { isUndefined, omitBy } from 'lodash'; // type FilterKeys = { [P in keyof O]: Contains extends true ? P : never }[keyof O]; // type Contains = B extends Extract ? true : false; // type PartialAndExcludeProps = Omit & { [P in K]?: Exclude }; export const omitUndefinedShallow = (o: O): { [P in keyof O]: Exclude } => omitBy(o, isUndefined) as any;