Open ataft opened 5 years ago
Any solution to this problem ?? help please
I've created this function in order to set a prefix to all keys in a given object:
function isRealObject(obj) {
return typeof obj === 'object' && obj !== null;
}
function addPrefixToKeys(obj, prefix) {
return Object.fromEntries(
Object.entries(obj).map(([k, v]) => {
const prefixedValue = isRealObject(v) ? addPrefixToKeys(v, prefix) : v;
return [prefix + k, prefixedValue];
})
);
}
But maybe there is something native on the lib, I just couldn't find it.
When going from XML to JS, the "processors.stripPrefix" allows you to remove the prefix. Is it possible for the Builder to have an option for addPrefix?
results in: