mirror of
https://github.com/cssgunc/compass.git
synced 2025-04-09 14:00:15 -04:00
17 lines
424 B
TypeScript
17 lines
424 B
TypeScript
import { Field } from "@/utils/classes/Field";
|
|
|
|
export class LinkFieldImpl extends Field {
|
|
constructor() {
|
|
super("LinkTableIcon", "Link");
|
|
}
|
|
|
|
validateInput(value: any): boolean {
|
|
if (typeof value !== "string") {
|
|
return false;
|
|
}
|
|
const urlRegex =
|
|
/^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$/;
|
|
return urlRegex.test(value);
|
|
}
|
|
}
|