We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
given below xml:
<?xml version="1.0" encoding="utf-8"?> <note importance="high" logged="true"> <title>Happy</title> <todo>Work</todo> <todo>Play</todo> </note>
if we parse with {compact: false} option, we will get none compact JS object:
{compact: false}
{ declaration: { attributes: { version: '1.0', encoding: 'utf-8' } }, elements: [ { type: 'element', name: 'note', attributes: [Object], elements: [Array] } ] }
For this JS object, are we able to manipulate it as a compact JS? js['note']['title']
js['note']['title']
Maybe use Proxy & Reflect in xml2js if {compact:false} applied?
{compact:false}
The text was updated successfully, but these errors were encountered:
new Proxy(result1, { get: (target, propKey, receiver) => { let type = Reflect.get(target, 'type', receiver); if (type === 'element' && propKey !== 'attributes' || !type && propKey !== 'declaration' && propKey !== 'elements') { return Reflect.get(target, 'elements', receiver).filter(e => e.name === propKey); } else { return Reflect.get(target, propKey, receiver); } } });
Sorry, something went wrong.
No branches or pull requests
given below xml:
if we parse with
{compact: false}
option, we will get none compact JS object:For this JS object, are we able to manipulate it as a compact JS?
js['note']['title']
Maybe use Proxy & Reflect in xml2js if
{compact:false}
applied?The text was updated successfully, but these errors were encountered: