@infra-blocks/zod-utils 0.13.0-alpha.0 → 0.13.0-alpha.2

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.
@@ -22,14 +22,6 @@ declare function stringtoInt(): z.ZodCodec<z.ZodString, z.ZodInt>;
22
22
  * @see https://zod.dev/codecs#stringtourl
23
23
  */
24
24
  declare function stringToUrl(): z.ZodCodec<z.ZodURL, z.ZodCustom<import("url").URL, import("url").URL>>;
25
- /**
26
- * A string to HTTP URL codec, as defined in Zod's documentation.
27
- *
28
- * @returns A string to HTTP URL codec.
29
- *
30
- * @see https://zod.dev/codecs#stringtohttpurl
31
- */
32
- declare function stringToHttpUrl(): z.ZodCodec<z.ZodURL, z.ZodCustom<import("url").URL, import("url").URL>>;
33
25
  /**
34
26
  * Returns a type guard function using the provided schema as the source of truth.
35
27
  *
@@ -97,7 +89,6 @@ declare const zu: {
97
89
  };
98
90
  csv: typeof csv;
99
91
  stringtoInt: typeof stringtoInt;
100
- stringToHttpUrl: typeof stringToHttpUrl;
101
92
  stringToUrl: typeof stringToUrl;
102
93
  typeGuard: typeof typeGuard;
103
94
  isValid: typeof isValid;
package/lib/cjs/index.js CHANGED
@@ -44,20 +44,6 @@ const stringToURLCodec = zod_1.z.codec(zod_1.z.url(), zod_1.z.instanceof(URL), {
44
44
  function stringToUrl() {
45
45
  return stringToURLCodec;
46
46
  }
47
- const stringToHttpURLCodec = zod_1.z.codec(zod_1.z.httpUrl(), zod_1.z.instanceof(URL), {
48
- decode: (urlString) => new URL(urlString),
49
- encode: (url) => url.href,
50
- });
51
- /**
52
- * A string to HTTP URL codec, as defined in Zod's documentation.
53
- *
54
- * @returns A string to HTTP URL codec.
55
- *
56
- * @see https://zod.dev/codecs#stringtohttpurl
57
- */
58
- function stringToHttpUrl() {
59
- return stringToHttpURLCodec;
60
- }
61
47
  /**
62
48
  * Returns a type guard function using the provided schema as the source of truth.
63
49
  *
@@ -100,7 +86,6 @@ const zu = {
100
86
  json: index_js_4.json,
101
87
  csv,
102
88
  stringtoInt,
103
- stringToHttpUrl,
104
89
  stringToUrl,
105
90
  typeGuard,
106
91
  isValid,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AACA,6BAAwB;AACxB,6CAAqC;AACrC,iDAA6C;AAC7C,6CAAqC;AACrC,8CAAuC;AAEvC,MAAM,SAAS,GAAG,OAAC,CAAC,MAAM,EAAE,CAAC,SAAS,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;AAEhE,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;AAExB;;;;GAIG;AACH,SAAS,GAAG;IACV,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,MAAM,gBAAgB,GAAG,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,OAAC,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,OAAC,CAAC,GAAG,EAAE,EAAE;IAC7E,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC;IACzC,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,QAAQ,EAAE;CAChC,CAAC,CAAC;AAEH;;;;;;GAMG;AACH,SAAS,WAAW;IAClB,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AAED,MAAM,gBAAgB,GAAG,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,GAAG,EAAE,EAAE,OAAC,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;IAC3D,MAAM,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,IAAI,GAAG,CAAC,SAAS,CAAC;IACzC,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI;CAC1B,CAAC,C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;AACzC,CAAC;AAED,MAAM,EAAE,GAAG;IACT,GAAG,EAAH,cAAG;IACH,OAAO,EAAP,kBAAO;IACP,GAAG,EAAH,cAAG;IACH,IAAI,EAAJ,eAAI;IACJ,GAAG;IACH,WAAW;IACX,WAAW;IACX,SAAS;IACT,OAAO;CACR,CAAC;AAEO,gBAAE"}
@@ -22,14 +22,6 @@ declare function stringtoInt(): z.ZodCodec<z.ZodString, z.ZodInt>;
22
22
  * @see https://zod.dev/codecs#stringtourl
23
23
  */
24
24
  declare function stringToUrl(): z.ZodCodec<z.ZodURL, z.ZodCustom<import("url").URL, import("url").URL>>;
25
- /**
26
- * A string to HTTP URL codec, as defined in Zod's documentation.
27
- *
28
- * @returns A string to HTTP URL codec.
29
- *
30
- * @see https://zod.dev/codecs#stringtohttpurl
31
- */
32
- declare function stringToHttpUrl(): z.ZodCodec<z.ZodURL, z.ZodCustom<import("url").URL, import("url").URL>>;
33
25
  /**
34
26
  * Returns a type guard function using the provided schema as the source of truth.
35
27
  *
@@ -97,7 +89,6 @@ declare const zu: {
97
89
  };
98
90
  csv: typeof csv;
99
91
  stringtoInt: typeof stringtoInt;
100
- stringToHttpUrl: typeof stringToHttpUrl;
101
92
  stringToUrl: typeof stringToUrl;
102
93
  typeGuard: typeof typeGuard;
103
94
  isValid: typeof isValid;
package/lib/esm/index.js CHANGED
@@ -41,20 +41,6 @@ const stringToURLCodec = z.codec(z.url(), z.instanceof(URL), {
41
41
  function stringToUrl() {
42
42
  return stringToURLCodec;
43
43
  }
44
- const stringToHttpURLCodec = z.codec(z.httpUrl(), z.instanceof(URL), {
45
- decode: (urlString) => new URL(urlString),
46
- encode: (url) => url.href,
47
- });
48
- /**
49
- * A string to HTTP URL codec, as defined in Zod's documentation.
50
- *
51
- * @returns A string to HTTP URL codec.
52
- *
53
- * @see https://zod.dev/codecs#stringtohttpurl
54
- */
55
- function stringToHttpUrl() {
56
- return stringToHttpURLCodec;
57
- }
58
44
  /**
59
45
  * Returns a type guard function using the provided schema as the source of truth.
60
46
  *
@@ -97,7 +83,6 @@ const zu = {
97
83
  json,
98
84
  csv,
99
85
  stringtoInt,
100
- stringToHttpUrl,
101
86
  stringToUrl,
102
87
  typeGuard,
103
88
  isValid,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAEvC,MAAM,SAAS,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,SAAS,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;AAEhE,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;AAExB;;;;GAIG;AACH,SAAS,GAAG;IACV,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,EAAE;IAC7E,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC;IACzC,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,QAAQ,EAAE;CAChC,CAAC,CAAC;AAEH;;;;;;GAMG;AACH,SAAS,WAAW;IAClB,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AAED,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,EAAE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AAS,WAAW;IAClB,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,SAAS,SAAS,CAAsB,MAAS;IAC/C,OAAO,CAAC,KAAc,EAAuB,EAAE;QAC7C,OAAO,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAChC,CAAC,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;GAWG;AACH,SAAS,OAAO,CACd,MAAS,EACT,KAAc;IAEd,OAAO,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC;AACzC,CAAC;AAED,MAAM,EAAE,GAAG;IACT,GAAG;IACH,OAAO;IACP,GAAG;IACH,IAAI;IACJ,GAAG;IACH,WAAW;IACX,WAAW;IACX,SAAS;IACT,OAAO;CACR,CAAC;AAEF,OAAO,EAAE,EAAE,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infra-blocks/zod-utils",
3
- "version": "0.13.0-alpha.0",
3
+ "version": "0.13.0-alpha.2",
4
4
  "description": "Extensions to the zod package.",
5
5
  "keywords": [
6
6
  "zod",