Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
261 B
1
Indexable
Never
checkIsUrl(element, field) {
		const regexp = new RegExp(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)?/gi)
		if (!field.match(regexp)) {
			throw [element, null, i18n.t('validator.url', [field])];
		}
	}