@mak-98/xml-dirvi-app 0.11.0-beta.13 → 0.11.0-beta.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-xml-entries.d.ts","sourceRoot":"","sources":["../../src/infrastructure/get-xml-entries.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAEpD,OAAO,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAiIjE,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,EAAE,YAAY,CAAC,CAK5E;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,SAAS,KAAK,EAAE,GACrB,SAAS,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"get-xml-entries.d.ts","sourceRoot":"","sources":["../../src/infrastructure/get-xml-entries.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAEpD,OAAO,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAiIjE,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,EAAE,YAAY,CAAC,CAK5E;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,SAAS,KAAK,EAAE,GACrB,SAAS,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC,EAAE,CA0C1C"}
|
|
@@ -115,7 +115,12 @@ export function createXmlRoot(filePath) {
|
|
|
115
115
|
* root; an empty path selects the document itself.
|
|
116
116
|
*/
|
|
117
117
|
export function getXmlEntries(filePath, source, path) {
|
|
118
|
-
const document = parseXml(source
|
|
118
|
+
const document = parseXml(source, {
|
|
119
|
+
preserveCdata: true,
|
|
120
|
+
preserveComments: true,
|
|
121
|
+
preserveDocumentType: true,
|
|
122
|
+
preserveXmlDeclaration: true,
|
|
123
|
+
});
|
|
119
124
|
let children = document.children;
|
|
120
125
|
let position = [];
|
|
121
126
|
for (const segment of path) {
|
|
@@ -130,5 +135,10 @@ export function getXmlEntries(filePath, source, path) {
|
|
|
130
135
|
position = [...position, index];
|
|
131
136
|
children = node.children;
|
|
132
137
|
}
|
|
133
|
-
return children
|
|
138
|
+
return children
|
|
139
|
+
.map((node, index) => ({ node, index }))
|
|
140
|
+
.filter(({ node }) => !(node instanceof XmlText &&
|
|
141
|
+
!node.preserveWhitespace &&
|
|
142
|
+
/^[\t\n\r ]*$/.test(node.text)))
|
|
143
|
+
.map(({ node, index }) => describeChild(filePath, [...position, index], node));
|
|
134
144
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mak-98/xml-dirvi-app",
|
|
3
|
-
"version": "0.11.0-beta.
|
|
3
|
+
"version": "0.11.0-beta.15.1",
|
|
4
4
|
"description": "XML file app for dirvi.",
|
|
5
5
|
"license": "GPL-3.0-or-later",
|
|
6
6
|
"type": "module",
|
|
@@ -20,12 +20,12 @@
|
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@rgrove/parse-xml": "^5.0.0",
|
|
23
|
-
"dirvi-apis": "0.11.0-beta.
|
|
23
|
+
"dirvi-apis": "0.11.0-beta.15",
|
|
24
24
|
"env-paths": "^4.0.0",
|
|
25
25
|
"zod": "^4.4.3"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"dirvi-lib": "0.11.0-beta.
|
|
28
|
+
"dirvi-lib": "0.11.0-beta.15",
|
|
29
29
|
"@types/node": "^22.0.0",
|
|
30
30
|
"typescript": "^5.0.0"
|
|
31
31
|
},
|