@ParagonLance shared an insightful cloud functions tutorial here, however, the cloud function code snippet is written in TypeScript instead of vanilla JavaScript.
What steps would be needed to convert the following TypeScript code into pure JavaScript?
const ClaimsDocumentData = {
_lastCommitted: undefined
}
export const mirrorCustomClaims =
functions.firestore.document('user-claims/{uid}')
.onWrite(async (change, context) => {
const beforeData =
change.before.data() || {}
const afterData =
change.after.data() || {}
})