Добавлены методы XML Inspector

This commit is contained in:
Book Pauk
2022-11-11 20:31:41 +07:00
parent 3d28beddac
commit a3190e4af3
2 changed files with 151 additions and 30 deletions

View File

@@ -3,7 +3,7 @@ class ObjectInspector {
this.raw = raw;
}
makeSelector(selector) {
narrowSelector(selector) {
const result = [];
selector = selector.trim();
@@ -31,7 +31,7 @@ class ObjectInspector {
}
select(selector = '') {
selector = this.makeSelector(selector);
selector = this.narrowSelector(selector);
let raw = this.raw;
for (const s of selector) {
@@ -50,14 +50,10 @@ class ObjectInspector {
}
if (raw === undefined || raw === null) {
raw = null;
break;
return [];
}
}
if (raw === null)
return [];
raw = (Array.isArray(raw) ? raw : [raw]);
const result = [];