Skip to content

Commit 2ca3a1f

Browse files
committed
fix: typing
1 parent 5724ca3 commit 2ca3a1f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/tools/xpath-tester/xpath-tester.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ const xml = ref('<book><title>Harry Potter</title></book>');
99
const selectedNodes = computed(() => {
1010
try {
1111
const doc = new DOMParser().parseFromString(xml.value, 'text/xml');
12-
return XPathEngine.select(xpath.value, doc);
12+
const result = XPathEngine.select(xpath.value, doc);
13+
return Array.isArray(result) ? result : [result];
1314
}
1415
catch (e: any) {
1516
return [e.toString()];

0 commit comments

Comments
 (0)