Skip to content
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

Decode filters #50

Closed
wants to merge 7 commits into from
Closed

Decode filters #50

wants to merge 7 commits into from

Conversation

rijnhard
Copy link

@rijnhard rijnhard commented Feb 4, 2016

Hi

I added the ability to specify decoding filters.
and provided a zendBoolean normalizer as a predefined filter.

It's still a pretty naive implementation in that only manipulates values.
Ideally it should be able to remove whole keys, but I would say that is additional functionality.

The reason for wanting to use filters is that it provides a nice simple way of guaranteeing that values meet an expected criteria after parsing. And it removes the need for complex object navigation in order to do it after the fact.

Rijnhard Hessel and others added 2 commits February 4, 2016 10:50
Provided zendBoolean default filter
Udpated readme
added test case
formatting
@rijnhard
Copy link
Author

@isaacs can we kick off a discussion on this?

  1. Do you like the concept of allowing parsing filters?
  2. (assuming yes) what would the requirements be to make this merge ready.
  3. (assuming changes) Lets talk design and criteria:
    1. do you want to allow key based filters (how to handle sections, and key matching...)

I also added the zendBoolean here for an illustration, but we either add more defaults, or I can separate them into standalone packages

@rijnhard
Copy link
Author

On and forgot - another topic, encode filters.

@rijnhard
Copy link
Author

I've been thinking how to make this more flexible.
Namely to handle keys and some pretty specific parsing logic that some other issues relate to like semi colons in string literals.
It does mean that the filters need to be used sooner in the parsing logic, and that a lot of predefined logic can be moved to filters.

the nasty parts are defining default filters if specific filters weren't defined, it makes me think a flagging system is better but that would limit the use of custom filters. I haven't yet thought of a decent way to make the function call simple and allow custom filters.

@rijnhard
Copy link
Author

Forking the project instead, since no feedback

@rijnhard rijnhard closed this May 24, 2018
@rijnhard rijnhard deleted the decode-filters branch May 24, 2018 11:25
@rijnhard rijnhard restored the decode-filters branch May 24, 2018 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant