mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-27 19:51:09 -04:00
new build
This commit is contained in:
@ -59,9 +59,9 @@ export default {
|
||||
.replace(/(\d{3})(?=\d)/g, '$1' + thousand_separator)
|
||||
let precisionText = precision
|
||||
? decimal_separator +
|
||||
Math.abs(amount - i)
|
||||
.toFixed(precision)
|
||||
.slice(2)
|
||||
Math.abs(amount - i)
|
||||
.toFixed(precision)
|
||||
.slice(2)
|
||||
: ''
|
||||
let combinedAmountText =
|
||||
negativeSign + thousandText + amountText + precisionText
|
||||
@ -95,11 +95,11 @@ export default {
|
||||
}
|
||||
let pattern = new RegExp(
|
||||
'^(https?:\\/\\/)?' + // protocol
|
||||
'((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|' + // domain name
|
||||
'((\\d{1,3}\\.){3}\\d{1,3}))' + // OR ip (v4) address
|
||||
'(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*' + // port and path
|
||||
'(\\?[;&a-z\\d%_.~+=-]*)?' + // query string
|
||||
'(\\#[-a-z\\d_]*)?$',
|
||||
'((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|' + // domain name
|
||||
'((\\d{1,3}\\.){3}\\d{1,3}))' + // OR ip (v4) address
|
||||
'(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*' + // port and path
|
||||
'(\\?[;&a-z\\d%_.~+=-]*)?' + // query string
|
||||
'(\\#[-a-z\\d_]*)?$',
|
||||
'i'
|
||||
) // fragment locator
|
||||
|
||||
@ -107,12 +107,20 @@ export default {
|
||||
},
|
||||
|
||||
checkValidDomainUrl(url) {
|
||||
if (url.includes('localhost')) {
|
||||
if (url.includes('localhost') || url.includes('127.0.0.1')) {
|
||||
return true
|
||||
}
|
||||
|
||||
let pattern = new RegExp(
|
||||
'^([0-9A-Za-z-\\.@:%_+~#=]+)+((\\.[a-zA-Z]{2,3})+)(/(.)*)?(\\?(.)*)?'
|
||||
)
|
||||
'^(https?:\\/\\/)?' + // protocol
|
||||
'((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|' + // domain name
|
||||
'((\\d{1,3}\\.){3}\\d{1,3}))' + // OR ip (v4) address
|
||||
'(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*' + // port and path
|
||||
'(\\?[;&a-z\\d%_.~+=-]*)?' + // query string
|
||||
'(\\#[-a-z\\d_]*)?$',
|
||||
'i'
|
||||
) // fragment locator
|
||||
|
||||
return !!pattern.test(url)
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user