Whenever a request is made. It would be nice to have a good warning when there are fields missing/mismatching from what we declared as expected
Possible implementation
src/utils/response.ts
const compareKeys = (expectedObject: object, subjectObject: object) => {
const expected = new Set(Object.keys(expectedObject))
const subject = new Set(Object.keys(subjectObject))
return {
missing: Array.from(expected.difference(subject)),
extra: Array.from(subject.difference(expected)),
}
}
I think there should be some checks to do since we have the snake and camelCase parsing which might or might not be involved at this point
Whenever a request is made. It would be nice to have a good warning when there are fields missing/mismatching from what we declared as expected
Possible implementation
src/utils/response.ts
I think there should be some checks to do since we have the snake and camelCase parsing which might or might not be involved at this point