Skip to content

Commit

Permalink
fix(Object): fix return type for _omit and _pick
Browse files Browse the repository at this point in the history
  • Loading branch information
mrnagydavid committed Feb 29, 2024
1 parent 4869d5e commit 1db7012
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/object/object.util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export function _pick<T extends AnyObject, K extends keyof T>(
obj: T,
props: readonly K[],
mutate = false,
): T {
): Pick<T, K> {
if (mutate) {
// Start as original object (mutable), DELETE properties that are not whitelisted
return Object.keys(obj).reduce((r, prop) => {
Expand All @@ -34,7 +34,7 @@ export function _omit<T extends AnyObject, K extends keyof T>(
obj: T,
props: readonly K[],
mutate = false,
): T {
): Omit<T, K> {
return props.reduce(
(r, prop) => {
delete r[prop]
Expand Down

0 comments on commit 1db7012

Please sign in to comment.