updates
This commit is contained in:
@@ -11,13 +11,15 @@ export class AppendOptions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (Ut.isStr(data)) {
|
if (Ut.isStr(data)) {
|
||||||
data.replace(/"((?:\\.|[^"\\])*)"\s*:\s*"((?:\\.|[^"\\])*)"/g, (_, rawKey, rawVal) => target.append(
|
|
||||||
new Option(
|
let options = '';
|
||||||
JSON.parse(`"${rawVal}"`),
|
|
||||||
JSON.parse(`"${rawKey}"`)
|
|
||||||
)
|
|
||||||
));
|
|
||||||
|
|
||||||
|
data.replace(/"((?:\\.|[^"\\])*)"\s*:\s*"((?:\\.|[^"\\])*)"/g,
|
||||||
|
(_, k, v) => (options += `<option value="${JSON.parse(`"${k}"`)}">${JSON.parse(`"${v}"`)}</option>`, '')
|
||||||
|
);
|
||||||
|
|
||||||
|
target.innerHTML = options;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user