Add new tests
This commit is contained in:
parent
81437ede41
commit
b1adc39a35
3 changed files with 50 additions and 4 deletions
src/helpers
|
@ -12,10 +12,6 @@ export default class ImageHelper {
|
|||
const dom = htmlparser.parseDocument(fetched.body);
|
||||
const img = htmlparser.DomUtils.findAll((x => x.tagName == "img" && x.attributes.find(y => y.value.includes("https://preview.redd.it")) != null), dom.children);
|
||||
|
||||
if (!img) {
|
||||
return [];
|
||||
}
|
||||
|
||||
const imgSrc = img
|
||||
.flatMap(x => x.attributes.find(x => x.name == "src")?.value)
|
||||
.filter(x => x != undefined);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue