Using bulk insert utility for alert notifications to prevent duplicate errors.
This commit is contained in:
@@ -130,6 +130,28 @@ function html(context, selector) {
|
||||
return el && el.innerHTML;
|
||||
}
|
||||
|
||||
function json(context, selector) {
|
||||
const el = q(context, selector, null, true);
|
||||
|
||||
try {
|
||||
return JSON.parse(el?.innerHTML);
|
||||
} catch (error) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
function jsons(context, selector) {
|
||||
const els = all(context, selector, null, true);
|
||||
|
||||
return els.map((el) => {
|
||||
try {
|
||||
return JSON.parse(el?.innerHTML);
|
||||
} catch (error) {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function htmls(context, selector) {
|
||||
const els = all(context, selector, null, true);
|
||||
|
||||
@@ -402,6 +424,8 @@ const quFuncs = {
|
||||
images,
|
||||
img: image,
|
||||
imgs: images,
|
||||
json,
|
||||
jsons,
|
||||
length: duration,
|
||||
meta,
|
||||
num: number,
|
||||
|
||||
Reference in New Issue
Block a user