Using lodash's cloneDeep method to create a copy of the object to be wrapped. The wrapper then uses the copy to store and retrieve property values.
Testing Performed
Verified that methods are cloned, which is interesting, given lodash's documentation: "An empty object is returned for uncloneable values such as functions, DOM nodes, Maps, Sets, and WeakMaps."
Verified that the original object is not modified by the wrapper. For instance, when the wrapper needs to replace a property with a wrapper, the new wrapper is not assigned to the original object.
Known Issues
The cloning process does not copy non-enumerable properties.
The failure to copy non-enumerable properties means that the wrapper object may behave significantly differently from the original object, depending on the application.
Requested reviewers: None Issues: #2
Summary of Changes
cloneDeep
method to create a copy of the object to be wrapped. The wrapper then uses the copy to store and retrieve property values.Testing Performed
Known Issues