Using bulk insert utility for alert notifications to prevent duplicate errors.

This commit is contained in:
DebaucheryLibrarian
2021-06-04 03:10:41 +02:00
parent 011bb4efa3
commit bed329cd8c
3 changed files with 35 additions and 12 deletions

View File

@@ -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,