mirror of
https://github.com/sharevb/it-tools.git
synced 2026-11-21 21:44:40 +03:00
fix: typing
This commit is contained in:
1 parent
5724ca346f
commit
2ca3a1fe96
1 file changed
+2
-1
@@ -9,7 +9,8 @@ const xml = ref('<book><title>Harry Potter</title></book>');
|
|||||||
const selectedNodes = computed(() => {
|
const selectedNodes = computed(() => {
|
||||||
try {
|
try {
|
||||||
const doc = new DOMParser().parseFromString(xml.value, 'text/xml');
|
const doc = new DOMParser().parseFromString(xml.value, 'text/xml');
|
||||||
return XPathEngine.select(xpath.value, doc);
|
const result = XPathEngine.select(xpath.value, doc);
|
||||||
|
return Array.isArray(result) ? result : [result];
|
||||||
}
|
}
|
||||||
catch (e: any) {
|
catch (e: any) {
|
||||||
return [e.toString()];
|
return [e.toString()];
|
||||||
|
|||||||
Reference in new issue
Block a user