Merge pull request #39 from lnbits/fix_images

feat: add more images for product
This commit is contained in:
Vlad Stan 2023-04-03 18:37:01 +03:00 committed by GitHub
commit 6dcd416e93
8 changed files with 51 additions and 73 deletions

View file

@ -111,3 +111,13 @@ function timeFromNow(time) {
// Return time from now data
return `${tfn.time} ${tfn.unitOfTime}`
}
function isValidImageUrl(string) {
let url
try {
url = new URL(string)
} catch (_) {
return false
}
return url.protocol === 'http:' || url.protocol === 'https:'
}