mirror of
https://gitlab.com/bramw/baserow.git
synced 2024-11-21 23:37:55 +00:00
21 lines
448 B
JavaScript
21 lines
448 B
JavaScript
import { isValidURL } from '@baserow/modules/core/utils/string'
|
|
import { ensureUrlProtocol } from '@baserow/modules/core/utils/url'
|
|
|
|
export default {
|
|
methods: {
|
|
isValid(value) {
|
|
return isValidURL(value?.url)
|
|
},
|
|
getLabelOrURL(value) {
|
|
if (!value) {
|
|
return ''
|
|
} else {
|
|
return value.label ? value.label : value.url
|
|
}
|
|
},
|
|
getHref(value) {
|
|
return ensureUrlProtocol(value)
|
|
},
|
|
},
|
|
}
|