import { O } from "./types/O.js"; import { omitUndefinedValues } from "./omitUndefinedValues.js"; import { OptionalKeys } from "./types/index.js"; export const removeOptionalKeysFromObjectStrings = ( object: TObject, keys: string[], ): TObject => { const newObject = keys.reduce((objectNow, key) => { return { ...objectNow, [key]: undefined, }; }, object); return omitUndefinedValues(newObject); }; export const removeOptionalKeysFromObject = ( object: TObject, keys: OptionalKeys[], ): TObject => { return removeOptionalKeysFromObjectStrings(object, keys); };