This commit is contained in:
2025-12-03 01:38:07 +02:00
parent f22f6b2bc8
commit 0b2a982ca3
+12 -3
View File
@@ -10,8 +10,17 @@ export class AppendOptions {
this.replaceChildren(); this.replaceChildren();
} }
Ut.each(Ut.isStr(data) if (Ut.isStr(data)) {
? data.replace(/"((?:\\.|[^"\\])*)"\s*:\s*"((?:\\.|[^"\\])*)"/g, (_, rawKey, rawVal) => target.append(new Option(JSON.parse(`"${rawVal}"`), JSON.parse(`"${rawKey}"`) )) ) data.replace(/"((?:\\.|[^"\\])*)"\s*:\s*"((?:\\.|[^"\\])*)"/g, (_, rawKey, rawVal) => target.append(
: data, (val, id) => target.append(new Option(val, id)) ); new Option(
JSON.parse(`"${rawVal}"`),
JSON.parse(`"${rawKey}"`)
)
));
return;
}
Ut.each(data, (val, id) => target.append(new Option(val, id)) );
} }
} }