Skip to content

Instantly share code, notes, and snippets.

@MichalZalecki MichalZalecki/mappet.ts Secret
Created Apr 23, 2019

Embed
What would you like to do?
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
You can’t perform that action at this time.