Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

O.P.Omit + U.Merge β€” issue with multiple nested omits from a single object #219

Open
mesqueeb opened this issue Mar 8, 2021 · 3 comments
Labels
bug Something isn't working
Projects

Comments

@mesqueeb
Copy link
Contributor

mesqueeb commented Mar 8, 2021

🐞 Bug Report

Describe the bug

Thanks so much yesterday to fix my edge cases with O.P.Pick!

I have one more edge case left in my library related to O.P.Omit + U.Merge.

Reproduce the bug

Signature:

omit<T extends Record<string, any>, K extends string>(
  obj: T,
  keys: F.AutoPath<T, K>[]
): U.Merge<O.P.Omit<T, S.Split<K, '.'>>>

Execution:

const doc = {
    nested: { omit: { yes: 0, no: 0 } },
    secondProp: true,
}

const res4 = omit(doc, ['nested.omit.yes', 'secondProp'])
  • typeof res4 is:

image

Expected behavior

I expected:

typeof res4 // to be equal to { nested: { omit: { no: number } } }

Possible Solution

I'm not sure : S maybe replace U.Merge with something else?

Reproduction

You can clone my production branch of mesqueeb/filter-anything
See the line:

https://github.com/mesqueeb/filter-anything/blob/4b43d7279711df448fc50882088d775dddca0897/test/index.ts#L81

@millsp millsp added the bug Something isn't working label Mar 8, 2021
@millsp millsp added this to To do in Board via automation Mar 29, 2021
@millsp
Copy link
Owner

millsp commented Mar 29, 2021

This issue is overlapping with #225 so I'll add priority on it. Sorry for the delays!

@mesqueeb
Copy link
Contributor Author

@millsp no problem man! you're an angel to the TS community. I won't ever pressure you : )

@stale
Copy link

stale bot commented Jun 2, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Jun 2, 2021
@stale stale bot closed this as completed Jun 18, 2021
Board automation moved this from To do to Done Jun 18, 2021
@millsp millsp reopened this Sep 3, 2021
Board automation moved this from Done to In progress Sep 3, 2021
@stale stale bot removed the wontfix This will not be worked on label Sep 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Board
  
In progress
Development

No branches or pull requests

2 participants