-
Notifications
You must be signed in to change notification settings - Fork 179
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
Feat. New option ignoreFunction
according to issue#32
#58
Conversation
index.js
Outdated
@@ -31,6 +31,18 @@ function escapeUnsafeChars(unsafeChar) { | |||
return ESCAPED_CHARS[unsafeChar]; | |||
} | |||
|
|||
function deleteFunctions(obj){ | |||
var functionKeys = [] | |||
for(var key in 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.
Actually I wrote this first
Object.keys(obj)
.filter(key => typeof obj[key] === "function")
.forEach(functionKey => {
delete obj[functionKey];
});
But I have no idea what the lowest browser the code should support to,
so I avoid to use Object.keys
Could @redonkulus help review this? |
@tom76kimo Thanks for reminding me. |
@okuryu Updated, thanks! |
@okuryu By the way, there is some inconsistent style in the original code. 2 space indents 4 space indents Maybe we should make a new pull request or issue to discuss about coding style, like lint check using |
yeah, I'll try to format with prettier separately. |
Okay, I'll work on merging and release on this until the end of tomorrow If there are no other comments. |
published v2.1.0. Thanks! |
I confirm that this contribution is made under the terms of the license found in the root directory of this repository's source tree and that I have the authority necessary to make this contribution on behalf of its copyright owner.
According to this issue #32 , I add a new option
ignoreFunction
for serialize.