-
-
Notifications
You must be signed in to change notification settings - Fork 357
Closed
Labels
PendingPending to be confirmed by user/author for some check/update/implementationPending to be confirmed by user/author for some check/update/implementationbug
Description
- Are you running the latest version?
- Have you included sample input, output, error, and expected output?
- Have you checked if you are using correct configuration?
- Did you try online tool?
Description
If XML contains a tag named <constructor>, an invalid object gets added to the output.
This does not happen if an attribute named constructor exists (and disabling any name prefix).
I traced it back to node2json.js:compress() (input into the function was fine, but output was problematic).
Code
import { XMLParser } from "fast-xml-parser";
const xml = `<root><constructor /></root>`;
const json = new XMLParser().parse(xml);
console.log(json);Output
{ root: { constructor: [ [Function: Object], '' ] } }
Expected data
{ root: { constructor: '' } }
Would you like to work on this issue?
- Yes
- No
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
PendingPending to be confirmed by user/author for some check/update/implementationPending to be confirmed by user/author for some check/update/implementationbug