To assert that the res object has not been modified, we need to perform a deep comparison of the res object before and after checkEmptyPayload has been called.
Instead of implementing this function ourselves, we can save time by using existing utility libraries. For instance, Lodash provides the cloneDeep method (lodash.com/docs/#cloneDeep) for deep cloning, and the isEqual method (lodash.com/docs/#isEqual) for deep object comparison.
To use these methods in our code, we can install the lodash package from npm, which contains hundreds of utility methods. However, we won't be using most of these methods in our project; if we install the entire utility library, most of the code would be unused. We should always try to ...