Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Space as null value flag #15

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Mejari
Copy link

@Mejari Mejari commented May 15, 2013

I needed slightly different behavior so I thought I would option-ize it. I've set up an additional "options" object parameter on the 3 parse methods (with backwards compatibility for iniparser.parse callback). Also updated readme and added test for the single new option: treatEmptyStringsAsNull, which will, as the name suggests, set the value of parameters that have no direct value (which come in as an empty string) to null.

For example:

var_with_noValue=

Would come in when the flag is false (default) as:

{
     var_withNoValue: ''
}

and the same thing would come in when the flag is true as:

{
     var_withNoValue: null
}

It should be relatively easy to add new parameters in the future.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants