Skip to content
Merged

Dev #2847

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,9 @@

/**
* Unflatten dot separated JSON objects into nested objects
*/
$.fn.unflattenObject = function(flatObj) {
const result = {};
for (const flatKey in flatObj) {
const value = flatObj[flatKey];
if (!flatKey) continue;
const keys = flatKey.split('.');
let cur = result;
for (let i = 0; i < keys.length; i++) {
const k = keys[i];
if (i === keys.length - 1) {
cur[k] = value;
} else {
cur[k] = cur[k] || {};
cur = cur[k];
}
}
}
return result;
}

return str
.replace(/^[A-Z]/, match => match.toLowerCase())
.replace(/\.[A-Z]/g, match => match.toLowerCase());
/**
* @public
* Handles zone fieldset serialization with DTO nesting
Expand Down
Loading