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

[Feature Request] Add parent field to RefinementCtx #3982

Open
Faithfinder opened this issue Feb 12, 2025 · 0 comments
Open

[Feature Request] Add parent field to RefinementCtx #3982

Faithfinder opened this issue Feb 12, 2025 · 0 comments

Comments

@Faithfinder
Copy link

I'm looking to transform an object like this:

const Raw = {
  value1: 1,
  value1_prev: 2,
  value2: 3,
  value2_prev: 4,
}

into an object like this:

const Parsed = {
  value1: {
    current: 1,
    prev: 2,
  },
  value2: {
    current: 3,
    prev: 4,
  }
}

It would be nice to define it via value1Schema.transform(), instead of a giant transform on the parent object, however I would need access to the parent object on the field to achieve that. Is that possible?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant