Closed honzas closed 4 years ago
@Leonidas-from-XIV can you please merge this PR
@honzas can you please add description of this new feature to README.md
@honzas sorry for latter plea. can you please add to emptyTag callback param of current value of tag. often ' ' (space) ignored by xml2js and 2 neighbor words collapsed
@ozknemoy not sure what you mean - could you give me an example?
@honzas sorry ... dig deeper into code and understood that its not the case
Thanks, looks good to me and a sensible solution to the problem of shared mutable references. Sorry for the long silence.
We can now specify empty object as default value when parsing xml. This empty object is then shared as a reference across all occurences - when we assign something to it, new value appears in all default empty objects (we don't want that).
By specifying function as default value for empty object, we can provide factory function which creates new empty object for each occurence individually.