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

feat: add transform method like dottie #116

Open
erfanium opened this issue May 29, 2024 · 1 comment
Open

feat: add transform method like dottie #116

erfanium opened this issue May 29, 2024 · 1 comment

Comments

@erfanium
Copy link

example:

const values = {
  'user.name': 'Gummy Bear',
  'user.email': '[email protected]',
  'user.professional.title': 'King',
  'user.professional.employer': 'Candy Mountain'
};
const transformed = dottie.transform(values);

/*
{
  user: {
    name: 'Gummy Bear',
    email: '[email protected]',
    professional: {
      title: 'King',
      employer: 'Candy Mountain'
    }
  }
}
*/
@stychu
Copy link

stychu commented Sep 5, 2024

Yess Please !!! im looking for something like this over all the internet and cant fing anything suitable that works good with typescript. Here is something I was trying to glue up but its not working properly for building array types which I cant find solution to yet...
@sindresorhus It would be awesome to have an ability to do deepKeys( flatten) and the undo action however it would be called (unflatten maybe)

Unflatten using flat lib but with not 100% working typings

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

No branches or pull requests

3 participants