Skip to content

Instantly share code, notes, and snippets.

@MichalZalecki
Created April 23, 2019 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MichalZalecki/ae4596f3f6820b34668d36cc35f3e929 to your computer and use it in GitHub Desktop.
Save MichalZalecki/ae4596f3f6820b34668d36cc35f3e929 to your computer and use it in GitHub Desktop.
const schema = {
firstName: "first_name",
cardNumber: "card.number",
};
const mapper = mappet(schema);
const source = {
first_name: "Michal",
last_name: "Zalecki",
card: {
number: "5555-5555-5555-4444",
},
};
const result = mapper(source);
// {
// firstName: "Michal",
// cardNumber: "5555-5555-5555-4444",
// }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment