refactor: simplified a regex in home.js

This commit is contained in:
Bobby Wibowo 2021-02-01 06:08:26 +07:00
parent 5a74776978
commit 274d922b2f
No known key found for this signature in database
GPG Key ID: 51C3A1E1E22D26CF

View File

@ -688,7 +688,7 @@ page.updateTemplate = (file, response) => {
link.classList.remove('is-hidden')
clipboard.parentElement.classList.remove('is-hidden')
const exec = /.[\w]+(\?|$)/.exec(response.url)
const exec = /.[\w]+$/.exec(response.url)
const extname = exec && exec[0]
? exec[0].toLowerCase()
: null