Skip to content
New issue

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

fix: enhance all kinds xpath queries and clean code #6920

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

zhengjitf
Copy link
Contributor

Closes #6898.

The root is the following condition statements miss else clause, so that it will cause error when selectedValues is a string.

if (typeof selectedValues === 'string') {
results = [{ outer: selectedValues, inner: selectedValues }];
}
results = (selectedValues as Node[])
.filter(sv => sv.nodeType === Node.ATTRIBUTE_NODE
|| sv.nodeType === Node.ELEMENT_NODE
|| sv.nodeType === Node.TEXT_NODE)
.map(selectedValue => {

I found similar code in queryXPath util function, so I refactored the code with it, and adjust queryXPath to deal with all kinds xpath queries.

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.

Complex XQuery Expression not working in Insomnia 8.4.5
1 participant