updates
This commit is contained in:
@@ -10,6 +10,8 @@ export class AppendOptions {
|
||||
this.replaceChildren();
|
||||
}
|
||||
|
||||
Ut.each(Ut.isStr(data) ? JSON.parse(data) : data, (val, id) => target.append(new Option(val, id)) );
|
||||
Ut.each(Ut.isStr(data)
|
||||
? data.replace(/"((?:\\.|[^"\\])*)"\s*:\s*"((?:\\.|[^"\\])*)"/g, (_, rawKey, rawVal) => target.append(new Option(JSON.parse(`"${rawVal}"`), JSON.parse(`"${rawKey}"`) )) )
|
||||
: data, (val, id) => target.append(new Option(val, id)) );
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user