FE_Stage / lib /parser.ts
GitHub Actions
Deploy from GitHub Actions [DEV] - 2025-10-30 13:18:59
01c0359
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;
}