Refactor key value comp (#2180)

* refactor: 💡 keyvalue comp
This commit is contained in:
Dharini Jeeva authored and GitHub committed 2024-06-03 13:38:42 -07:00
1 parent 9b403b3159
commit 6397cd80a6
22 files changed
+531 -405

No files matched your search

@@ -9,13 +9,13 @@ export default class AccountValueMapArrayTransform extends Transform {
deserialize(serialized) {
const accountValues = serialized || [];
return accountValues.map((accountValueString) => ({
from: accountValueString.split('=')[0],
to: accountValueString.split('=')[1],
key: accountValueString.split('=')[0],
value: accountValueString.split('=')[1],
}));
}
serialize(deserialized) {
const accountValues = deserialized || [];
return accountValues.map(({ from, to }) => `${from}=${to}`);
return accountValues.map(({ key, value }) => `${key}=${value}`);
}
}