quintodrome/ui/src/utils/validations.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

13 lines
183 B
JavaScript
Raw Normal View History

2023-01-24 16:58:20 -09:00
export const urlValidate = (value) => {
if (!value) {
return undefined
}
try {
new URL(value)
return undefined
} catch (_) {
return 'ra.validation.url'
}
}