Created
February 29, 2020 13:42
-
-
Save WimJongeneel/6f4c256f50c3c10d53d847b2fa958e78 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const mutations_to_odata = <T>(entity: TrackedEntity<T>, model: string) : string => { | |
const obj = { | |
"@odata.type": model, | |
} | |
entity.mutations.forEach(m => { | |
obj[m.prop] = m.value | |
}) | |
return JSON.stringify(obj, null, ' ') | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment