UNPKG

xml2customjs

Version:

Library to custom convert an XML into a Javascript object or JSON

16 lines (15 loc) 824 B
import { AnyObject } from "../interfaces"; /** * This function receives a value of type any and returns it converted to an object * using 'value' as the key. If the value is an object with xmlBuilder2 format (using * '@' at the beginning of attributes keys and '#' for the value of the xml tag), it * will return the same object without the "@" prefix and replacing '#' for 'value' * if the object has other non-attribute props, prop value will not be returned unless * in the original value there's a '#' prop. * If the '#' value is undefined it will be set to null instead. If the original * value only has attribute props (with '@' prefix), the object returned will have a * 'value' prop with null value * @param value * @returns object */ export declare function convertValueToObject(value: any): AnyObject;