UNPKG

@keycloakify/keycloak-admin-ui

Version:
18 lines 599 B
export function keyValueToArray(attributeArray = []) { const validAttributes = attributeArray.filter(({ key }) => key !== ""); const result = {}; for (const { key, value } of validAttributes) { if (key in result) { result[key].push(value); } else { result[key] = [value]; } } return result; } export function arrayToKeyValue(attributes = {}) { const result = Object.entries(attributes).flatMap(([key, value]) => value.map((value) => ({ key, value }))); return result; } //# sourceMappingURL=key-value-convert.js.map