type ReturnType = Pick>; export const without = ( input: T, key: K, ): ReturnType => { if (!(key in input)) { return input; } const result: any = Array.isArray(input) ? [] : {}; for (const inputKey in input) { if (inputKey !== String(key)) { result[inputKey] = input[inputKey]; } } return result; };