add validation, helpers, tests

This commit is contained in:
Alex Holliday committed 2026-09-10 12:23:20 -07:00
1 parent 131fd1a6b0
commit 5eb16fdbdb
13 files changed
+249 -13

No files matched your search

+5
View File
@@ -0,0 +1,5 @@
export const DOCKER_TLS_URL = /^(tcp|https):\/\/([^/\s:]+)(?::(\d+))?\/?$/;
export const DOCKER_SOCKET_URL = /^(?:unix:\/\/\/\S+|\/\S+)$/;
export const isDockerTlsUrl = (url: string | undefined): boolean => DOCKER_TLS_URL.test(url?.trim() ?? "");
export const isDockerSocketUrl = (url: string | undefined): boolean => DOCKER_SOCKET_URL.test(url?.trim() ?? "");