Skip to content

Instantly share code, notes, and snippets.

@wildskyf
Created February 11, 2020 08:10
Show Gist options
  • Save wildskyf/4c5f882ae468b94cda2251949b952f1f to your computer and use it in GitHub Desktop.
Save wildskyf/4c5f882ae468b94cda2251949b952f1f to your computer and use it in GitHub Desktop.
tool
export const swapObjKeyValue = (json: any) => {
const ret: any = {}
for (const key in json) {
ret[json[key]] = key
}
return ret
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment