-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Deep/Shallow Copy methods #42
Conversation
hopefully only tests left to add |
Decided to leave further changes to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Only two minor requests
target | ||
|
||
// internal helper function to deep copy a boxed object (if possible) | ||
static member internal tryDeepCopyObj (o:obj) = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would prefere if you could move this into a publicly accessible helper module (RequireQualifiedAccess?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is so specific, i am not sure if it is ever useful for other purposes. Also, this function uses the DynamicObj class and is used in it
@@ -4,7 +4,7 @@ open Fable.Pyxpecto | |||
|
|||
let all = testSequenced <| testList "DynamicObj" [ | |||
ReflectionUtils.Tests.main | |||
DynamicObj.Tests.main | |||
DynamicObjs.Tests.main |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the "s"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that was the name of the file i refactored into separate ones 🤷
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah also, this:
A namespace and a module named 'DynamicObj.Tests' both occur in two parts of this assembly
This PR
ShallowCopyDynamicProperties(To)
: The 'old' copy method, does not atttempt to do any copy logic on nested dynamic objects, lists, etc. Also, copied properties are reference equal where applicable (meaning mutating them on the source object will mutate them on the copied object). It is now properly named and has better xml docsDeepCopyDynamicProperties(To)
: Attempts toICloneable