@railway-ts/pipelines 0.1.19 → 0.1.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -273,6 +273,16 @@ function email(message = "Invalid email format") {
273
273
  const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
274
274
  return pattern(emailRegex, message);
275
275
  }
276
+ function url(message = "Invalid URL format") {
277
+ return (value, path = []) => {
278
+ try {
279
+ new URL(value);
280
+ return ok(value);
281
+ } catch {
282
+ return err([{ path, message }]);
283
+ }
284
+ };
285
+ }
276
286
  function phoneNumber(message = "Invalid phone number format") {
277
287
  const phoneRegex = /^\+?[\d\s\-()]{8,20}$/;
278
288
  return (value, path = []) => {
@@ -998,6 +1008,7 @@ exports.tuple = tuple;
998
1008
  exports.tupleOf = tupleOf;
999
1009
  exports.union = union;
1000
1010
  exports.unique = unique;
1011
+ exports.url = url;
1001
1012
  exports.validate = validate;
1002
1013
  exports.validateAndFormatResult = validateAndFormatResult;
1003
1014
  //# sourceMappingURL=index.cjs.map