FE_Test / lib /parser.ts
GitHub Actions
Deploy from GitHub Actions [test] - 2025-10-31 10:18:25
5f2aab6
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;
}