MCPcopy
hub / github.com/triggerdotdev/trigger.dev / createUrlValidator

Function createUrlValidator

packages/cli/src/cli/index.ts:262–274  ·  view source on GitHub ↗
(flagName: string)

Source from the content-addressed store, hash-verified

260// If the input is a string like test-cloud.trigger.dev, we should automatically add https://
261// If the input is a string like localhost:3030, we should automatically add http://
262function createUrlValidator(flagName: string): (input: string) => string {
263 return (input: string) => {
264 try {
265 const possibleUrl = tryToCreateValidUrlFromValue(input);
266
267 new URL(possibleUrl);
268
269 return possibleUrl;
270 } catch (e) {
271 throw new Error(`Please enter a valid URL for the ${flagName} flag`);
272 }
273 };
274}
275
276function tryToCreateValidUrlFromValue(input: string): string {
277 let possibleUrl = input;

Callers 1

index.tsFile · 0.85

Calls 1

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…