{"version":3,"file":"url.mjs","names":[],"sources":["../../../../../../../../@warlock.js/seal/src/rules/string/url.ts"],"sourcesContent":["import { invalidRule, VALID_RULE } from \"../../helpers\";\r\nimport type { SchemaRule } from \"../../types\";\r\n\r\n/**\r\n * URL rule - validates URL format\r\n */\r\nexport const urlRule: SchemaRule = {\r\n  name: \"url\",\r\n  defaultErrorMessage: \"The :input must be a valid URL\",\r\n  async validate(value: any, context) {\r\n    try {\r\n      new URL(value);\r\n      return VALID_RULE;\r\n    } catch {\r\n      return invalidRule(this, context);\r\n    }\r\n  },\r\n};\r\n"],"mappings":";;;;;;;AAMA,MAAa,UAAsB;CACjC,MAAM;CACN,qBAAqB;CACrB,MAAM,SAAS,OAAY,SAAS;EAClC,IAAI;GACF,IAAI,IAAI,KAAK;GACb,OAAO;EACT,QAAQ;GACN,OAAO,YAAY,MAAM,OAAO;EAClC;CACF;AACF"}