@zenobius/opencode-skillful 1.2.0-next.6 → 1.2.1-next.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.
- package/dist/index.js +8 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -23008,8 +23008,14 @@ var createJsonPromptRenderer = () => {
|
|
|
23008
23008
|
function escapeXml(str2) {
|
|
23009
23009
|
return String(str2).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
23010
23010
|
}
|
|
23011
|
+
function mapToObject(map2) {
|
|
23012
|
+
return Object.fromEntries(map2.entries());
|
|
23013
|
+
}
|
|
23011
23014
|
function jsonToXml(json2, rootElement = "root") {
|
|
23012
23015
|
let xml = `<${rootElement}>`;
|
|
23016
|
+
if (json2 instanceof Map) {
|
|
23017
|
+
return jsonToXml(mapToObject(json2), rootElement);
|
|
23018
|
+
}
|
|
23013
23019
|
for (const key in json2) {
|
|
23014
23020
|
if (!Object.hasOwn(json2, key)) {
|
|
23015
23021
|
continue;
|
|
@@ -23022,6 +23028,8 @@ function jsonToXml(json2, rootElement = "root") {
|
|
|
23022
23028
|
for (const item of value) {
|
|
23023
23029
|
xml += jsonToXml(item, key);
|
|
23024
23030
|
}
|
|
23031
|
+
} else if (value instanceof Map) {
|
|
23032
|
+
xml += jsonToXml(mapToObject(value), key);
|
|
23025
23033
|
} else if (typeof value === "object" && value !== null) {
|
|
23026
23034
|
xml += jsonToXml(value, key);
|
|
23027
23035
|
} else if (value !== undefined && value !== null) {
|
package/package.json
CHANGED