-
Notifications
You must be signed in to change notification settings - Fork 131
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 option to exclude undefined values when encoding objects #71 #97
base: master
Are you sure you want to change the base?
Conversation
@@ -31,6 +31,7 @@ function getWriteType(options) { | |||
var bin = binarraybuffer ? bin_arraybuffer : bin_buffer; | |||
var usemap = HAS_MAP && options && options.usemap; | |||
var map = usemap ? map_to_map : obj_to_map; | |||
var strip_undef = options && options.strip_undef; |
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.
how about calling it omit_undefined_properties
?
undef
is needlessly terse, and by spelling out the "properties" part, we're clear that it doesn't remove them from array elements.
var strip_undef = options && options.strip_undef; | |
var strip_undef = options && options.omit_undefined_properties; |
@AArnott can you review this PR and state what changes are required to get this merged? The original contributor may have abandoned the PR, but this would be a useful addition to the library IMO, and if the only outstanding issue is to rename the option, that should be easy to get over the line. |
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.
The functional change looks adequate. It just could use a rename of the option.
Any updates on getting this PR merged? |
No description provided.