Add tests for TransposeFolderData and make it so it replaces multiple items in onekey

This commit is contained in:
zkldi
2021-12-13 18:45:51 +00:00
parent 4f06d4f096
commit 78710a07bb
2 changed files with 46 additions and 2 deletions
+1 -1
View File
@@ -93,7 +93,7 @@ export function TransposeFolderData(obj: Record<string, unknown>) {
const transposedObj: Record<string, unknown> = {};
for (const key in obj) {
const transposedKey = key.replace(/~/u, "$").replace(/¬/u, ".");
const transposedKey = key.replace(/~/gu, "$").replace(/¬/gu, ".");
if (typeof obj[key] === "object" && obj[key]) {
transposedObj[transposedKey] = TransposeFolderData(obj[key] as Record<string, unknown>);