FE_Dev / lib /parser.ts
GitHub Actions
Deploy from GitHub Actions [dev] - 2025-10-31 07:28:50
68f7925
export function parseToJSON(xmlString: string) {
const attributes = xmlString.match(/(\w+)='([^']*)'/g);
const jsonObject: Record<string, string> = {};
if (attributes) {
attributes.forEach((attr) => {
const [key, value] = attr.split('=');
jsonObject[key] = value.replace(/'/g, '');
});
}
return jsonObject;
}