Skip to content

Conversation

massimo-ua
Copy link
Contributor

Purpose / Goal

This is a feature request for an option that makes the parser return a property for the textNodeName even if there are no attributes or node children. This prevents the downstream consuming JS to require checks for the text node and if it doesn't exist, use the property path itself.

Option would default to false so that the current behavior remains default.

Type

Please mention the type of PR

  • [ ]Bug Fix
  • [ ]Refactoring / Technology upgrade
  • [x]New Feature

Issue

349

Perfomance tests

Before

Running Suite: XML Parser benchmark
validation : 22482.344697710287 requests/second
xml to json : 15002.244861535037 requests/second
xml to json + json string : 13868.767986614608 requests/second
xml to json string : 2939.2827347641673 requests/second
xml2js : 5709.279811841135 requests/second

After

Running Suite: XML Parser benchmark
validation : 22732.947506604152 requests/second
xml to json : 15270.010037240734 requests/second
xml to json + json string : 14049.966577736843 requests/second
xml to json string : 2906.0090047436674 requests/second
xml2js : 5690.710124230496 requests/second

@haddadnj
Copy link
Contributor

haddadnj commented Oct 1, 2021

+1 on this feature

@coveralls
Copy link

coveralls commented Oct 2, 2021

Coverage Status

Coverage remained the same at 87.9% when pulling 2071682 on massimo-ua:develop into 10bbdee on NaturalIntelligence:master.

@amitguptagwl amitguptagwl merged commit 0d117f2 into NaturalIntelligence:master Oct 2, 2021
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.

4 participants