-
Notifications
You must be signed in to change notification settings - Fork 129
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
Enable clone to be extended. #108
base: master
Are you sure you want to change the base?
Conversation
…ach item. If it returns undefined, then the normal _clone continues. If it returns something, this is used as the item being cloned.
ref the end of #106 : this mod may be demonstrated using the below code:
|
@pvorb - if uyou like this PR, then just say and I'll add to the readme. |
The V8 crash protection is based on a simple list of '[object Type]' strings, and is in the extensible portion, so anyone can enhance the protection as more types are discovered that can't be cloned. or indeed, in my case
|
replaces #93 - but allows for the same kind of global modification of clone behaviour.
add clone.globalopts containing _clone.
If set, globalopts._clone is called with each item at the start of _clone().
If it returns undefined, then the normal _clone() continues.
If it returns something, the result is is used as the item being cloned, and the rest of _clone() is skipped.
ToDo:
like. If you don't do it, you won't be mentioned.
Thanks!