@bgord/tools 1.3.24 → 1.4.1

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.
Files changed (125) hide show
  1. package/dist/age-years.vo.d.ts +3 -3
  2. package/dist/age-years.vo.js +4 -9
  3. package/dist/age.vo.js +2 -1
  4. package/dist/api-key.vo.d.ts +3 -4
  5. package/dist/api-key.vo.js +5 -9
  6. package/dist/basename.vo.d.ts +3 -3
  7. package/dist/basename.vo.js +10 -15
  8. package/dist/day-iso-id.vo.d.ts +3 -3
  9. package/dist/day-iso-id.vo.js +4 -8
  10. package/dist/day.vo.d.ts +1 -1
  11. package/dist/day.vo.js +7 -6
  12. package/dist/directory-path-absolute.vo.d.ts +3 -3
  13. package/dist/directory-path-absolute.vo.js +5 -12
  14. package/dist/directory-path-relative.vo.d.ts +3 -3
  15. package/dist/directory-path-relative.vo.js +5 -12
  16. package/dist/distance-value.vo.d.ts +3 -3
  17. package/dist/distance-value.vo.js +4 -8
  18. package/dist/distance.vo.js +7 -6
  19. package/dist/division-factor.vo.d.ts +3 -3
  20. package/dist/division-factor.vo.js +4 -7
  21. package/dist/duration-ms.vo.d.ts +3 -3
  22. package/dist/duration-ms.vo.js +4 -3
  23. package/dist/duration.service.js +2 -1
  24. package/dist/email.vo.d.ts +3 -3
  25. package/dist/email.vo.js +3 -3
  26. package/dist/etags.vo.js +3 -2
  27. package/dist/extension.vo.d.ts +3 -3
  28. package/dist/extension.vo.js +6 -12
  29. package/dist/feature-flag-value.vo.d.ts +3 -3
  30. package/dist/feature-flag-value.vo.js +2 -2
  31. package/dist/file-path-absolute-schema.vo.d.ts +8 -5
  32. package/dist/file-path-absolute-schema.vo.js +6 -13
  33. package/dist/file-path-relative-schema.vo.d.ts +8 -5
  34. package/dist/file-path-relative-schema.vo.js +6 -13
  35. package/dist/file-path.vo.js +5 -4
  36. package/dist/filename-affix.vo.d.ts +3 -3
  37. package/dist/filename-affix.vo.js +4 -9
  38. package/dist/filename-from-string.vo.d.ts +6 -6
  39. package/dist/filename-from-string.vo.js +5 -8
  40. package/dist/filename.vo.js +8 -7
  41. package/dist/height-milimiters.vo.d.ts +3 -3
  42. package/dist/height-milimiters.vo.js +4 -8
  43. package/dist/height.vo.js +4 -3
  44. package/dist/hour-value.vo.d.ts +3 -3
  45. package/dist/hour-value.vo.js +4 -9
  46. package/dist/hour.vo.js +3 -2
  47. package/dist/iban-schema.vo.d.ts +3 -3
  48. package/dist/iban-schema.vo.js +4 -9
  49. package/dist/iban.vo.js +2 -1
  50. package/dist/image.vo.d.ts +5 -5
  51. package/dist/image.vo.js +7 -17
  52. package/dist/integer-non-negative.vo.d.ts +3 -3
  53. package/dist/integer-non-negative.vo.js +4 -8
  54. package/dist/integer-positive.vo.d.ts +3 -3
  55. package/dist/integer-positive.vo.js +4 -8
  56. package/dist/integer.vo.d.ts +3 -3
  57. package/dist/integer.vo.js +3 -3
  58. package/dist/language.vo.d.ts +3 -3
  59. package/dist/language.vo.js +2 -2
  60. package/dist/mime-value.vo.d.ts +3 -2
  61. package/dist/mime-value.vo.js +4 -7
  62. package/dist/mime.vo.js +2 -1
  63. package/dist/mimes.js +12 -11
  64. package/dist/minute-value.vo.d.ts +3 -3
  65. package/dist/minute-value.vo.js +4 -9
  66. package/dist/minute.vo.js +3 -2
  67. package/dist/money-amount.vo.d.ts +3 -3
  68. package/dist/money-amount.vo.js +4 -8
  69. package/dist/money.vo.js +7 -6
  70. package/dist/month-iso-id.vo.d.ts +3 -3
  71. package/dist/month-iso-id.vo.js +5 -9
  72. package/dist/month.vo.js +5 -4
  73. package/dist/multiplication-factor.vo.d.ts +3 -3
  74. package/dist/multiplication-factor.vo.js +4 -7
  75. package/dist/object-key.vo.d.ts +3 -3
  76. package/dist/object-key.vo.js +8 -13
  77. package/dist/package-version-schema.vo.d.ts +3 -3
  78. package/dist/package-version-schema.vo.js +4 -7
  79. package/dist/package-version.vo.js +3 -4
  80. package/dist/pagination-page.vo.d.ts +3 -3
  81. package/dist/pagination-page.vo.js +2 -6
  82. package/dist/pagination-skip.vo.d.ts +3 -3
  83. package/dist/pagination-skip.vo.js +2 -5
  84. package/dist/pagination-take.vo.d.ts +3 -3
  85. package/dist/pagination-take.vo.js +2 -5
  86. package/dist/pagination.service.js +8 -7
  87. package/dist/quarter-iso-id.vo.d.ts +4 -3
  88. package/dist/quarter-iso-id.vo.js +7 -11
  89. package/dist/quarter.vo.js +3 -2
  90. package/dist/reordering-item-position-value.vo.d.ts +3 -3
  91. package/dist/reordering-item-position-value.vo.js +2 -5
  92. package/dist/reordering.service.d.ts +9 -9
  93. package/dist/reordering.service.js +7 -7
  94. package/dist/revision-value.vo.d.ts +3 -3
  95. package/dist/revision-value.vo.js +2 -5
  96. package/dist/revision.vo.js +3 -2
  97. package/dist/rounding-decimal.strategy.d.ts +2 -2
  98. package/dist/rounding-decimal.strategy.js +5 -10
  99. package/dist/size-bytes.vo.d.ts +3 -3
  100. package/dist/size-bytes.vo.js +4 -8
  101. package/dist/size.vo.js +5 -4
  102. package/dist/time-zone-offset-value.vo.d.ts +3 -3
  103. package/dist/time-zone-offset-value.vo.js +8 -12
  104. package/dist/timestamp-value.vo.d.ts +3 -3
  105. package/dist/timestamp-value.vo.js +4 -8
  106. package/dist/timestamp.vo.js +2 -1
  107. package/dist/timezone.vo.d.ts +3 -3
  108. package/dist/timezone.vo.js +7 -10
  109. package/dist/url-with-slash.vo.d.ts +3 -3
  110. package/dist/url-with-slash.vo.js +4 -7
  111. package/dist/url-without-slash.vo.d.ts +3 -3
  112. package/dist/url-without-slash.vo.js +4 -7
  113. package/dist/week-iso-id.vo.d.ts +3 -3
  114. package/dist/week-iso-id.vo.js +5 -9
  115. package/dist/week.vo.js +5 -4
  116. package/dist/weekday-iso-id.vo.d.ts +3 -3
  117. package/dist/weekday-iso-id.vo.js +4 -9
  118. package/dist/weekday.vo.js +9 -8
  119. package/dist/weight-grams.vo.d.ts +3 -3
  120. package/dist/weight-grams.vo.js +4 -8
  121. package/dist/weight.vo.js +8 -7
  122. package/dist/year-iso-id.vo.d.ts +3 -3
  123. package/dist/year-iso-id.vo.js +4 -7
  124. package/dist/year.vo.js +6 -5
  125. package/package.json +9 -12
@@ -1,4 +1,4 @@
1
- import * as z from "zod/v4";
1
+ import * as v from "valibot";
2
2
  import { DirectoryPathRelativeSchema } from "./directory-path-relative.vo";
3
3
  import { Filename } from "./filename.vo";
4
4
  export const FilePathRelativeSchemaError = {
@@ -8,20 +8,13 @@ export const FilePathRelativeSchemaError = {
8
8
  RequiresDirectory: "file.path.relative.requires.directory",
9
9
  Empty: "file.path.relative.empty",
10
10
  };
11
- // Stryker disable all
12
- export const FilePathRelativeSchema = z
13
- // Stryker restore all
14
- .string(FilePathRelativeSchemaError.Type)
15
- .min(1, FilePathRelativeSchemaError.Empty)
16
- .refine((value) => !value.startsWith("/"), FilePathRelativeSchemaError.LeadingSlash)
17
- .refine((value) => !value.includes("\\"), FilePathRelativeSchemaError.BackslashForbidden)
18
- .refine((value) => value.includes("/"), FilePathRelativeSchemaError.RequiresDirectory)
19
- .transform((normalized) => {
11
+ export const FilePathRelativeSchema = v.pipe(v.string(FilePathRelativeSchemaError.Type), v.minLength(1, FilePathRelativeSchemaError.Empty), v.check((value) => !value.startsWith("/"), FilePathRelativeSchemaError.LeadingSlash), v.check((value) => !value.includes("\\"), FilePathRelativeSchemaError.BackslashForbidden), v.check((value) => value.includes("/"), FilePathRelativeSchemaError.RequiresDirectory), v.transform((normalized) => {
20
12
  const lastSlashIndex = normalized.lastIndexOf("/");
21
13
  const directoryCandidate = normalized.slice(0, lastSlashIndex);
22
14
  const filenameCandidate = normalized.slice(lastSlashIndex + 1);
23
- const directory = DirectoryPathRelativeSchema.parse(directoryCandidate);
15
+ const directory = v.parse(DirectoryPathRelativeSchema, directoryCandidate);
24
16
  const filename = Filename.fromString(filenameCandidate);
25
17
  return { directory, filename };
26
- })
27
- .brand("FilePathRelativeSchema");
18
+ }),
19
+ // Stryker disable next-line StringLiteral
20
+ v.brand("FilePathRelativeSchema"));
@@ -1,3 +1,4 @@
1
+ import * as v from "valibot";
1
2
  import { DirectoryPathAbsoluteSchema } from "./directory-path-absolute.vo";
2
3
  import { DirectoryPathRelativeSchema } from "./directory-path-relative.vo";
3
4
  import { FilePathAbsoluteSchema } from "./file-path-absolute-schema.vo";
@@ -10,14 +11,14 @@ export class FilePathRelative {
10
11
  this.filename = filename;
11
12
  }
12
13
  static fromParts(directoryCandidate, filename) {
13
- const directory = DirectoryPathRelativeSchema.parse(directoryCandidate);
14
+ const directory = v.parse(DirectoryPathRelativeSchema, directoryCandidate);
14
15
  return new FilePathRelative(directory, filename);
15
16
  }
16
17
  static fromPartsSafe(directory, filename) {
17
18
  return new FilePathRelative(directory, filename);
18
19
  }
19
20
  static fromString(candidate) {
20
- const schema = FilePathRelativeSchema.parse(candidate);
21
+ const schema = v.parse(FilePathRelativeSchema, candidate);
21
22
  return new FilePathRelative(schema.directory, schema.filename);
22
23
  }
23
24
  get() {
@@ -47,14 +48,14 @@ export class FilePathAbsolute {
47
48
  this.filename = filename;
48
49
  }
49
50
  static fromParts(directoryCandidate, filename) {
50
- const directory = DirectoryPathAbsoluteSchema.parse(directoryCandidate);
51
+ const directory = v.parse(DirectoryPathAbsoluteSchema, directoryCandidate);
51
52
  return new FilePathAbsolute(directory, filename);
52
53
  }
53
54
  static fromPartsSafe(directory, filename) {
54
55
  return new FilePathAbsolute(directory, filename);
55
56
  }
56
57
  static fromString(candidate) {
57
- const schema = FilePathAbsoluteSchema.parse(candidate);
58
+ const schema = v.parse(FilePathAbsoluteSchema, candidate);
58
59
  return new FilePathAbsolute(schema.directory, schema.filename);
59
60
  }
60
61
  get() {
@@ -1,4 +1,4 @@
1
- import * as z from "zod/v4";
1
+ import * as v from "valibot";
2
2
  export declare enum FilenameAffixStrategy {
3
3
  prefix = "prefix",
4
4
  suffix = "suffix"
@@ -9,5 +9,5 @@ export declare const FilenameAffixError: {
9
9
  TooLong: string;
10
10
  BadChars: string;
11
11
  };
12
- export declare const FilenameAffix: z.core.$ZodBranded<z.ZodString, "FilenameAffix", "out">;
13
- export type FilenameAffixType = z.infer<typeof FilenameAffix>;
12
+ export declare const FilenameAffix: v.SchemaWithPipe<readonly [v.StringSchema<string>, v.MinLengthAction<string, 1, string>, v.MaxLengthAction<string, 32, string>, v.RegexAction<string, string>, v.BrandAction<string, "FilenameAffix">]>;
13
+ export type FilenameAffixType = v.InferOutput<typeof FilenameAffix>;
@@ -1,4 +1,4 @@
1
- import * as z from "zod/v4";
1
+ import * as v from "valibot";
2
2
  export var FilenameAffixStrategy;
3
3
  (function (FilenameAffixStrategy) {
4
4
  FilenameAffixStrategy["prefix"] = "prefix";
@@ -12,11 +12,6 @@ export const FilenameAffixError = {
12
12
  };
13
13
  // Letters, digits, underscores, and hyphens allowed
14
14
  const FILENAME_AFFIX_WHITELIST = /^[a-zA-Z0-9_-]+$/;
15
- // Stryker disable all
16
- export const FilenameAffix = z
17
- // Stryker restore all
18
- .string(FilenameAffixError.Type)
19
- .min(1, FilenameAffixError.Empty)
20
- .max(32, FilenameAffixError.TooLong)
21
- .regex(FILENAME_AFFIX_WHITELIST, FilenameAffixError.BadChars)
22
- .brand("FilenameAffix");
15
+ export const FilenameAffix = v.pipe(v.string(FilenameAffixError.Type), v.minLength(1, FilenameAffixError.Empty), v.maxLength(32, FilenameAffixError.TooLong), v.regex(FILENAME_AFFIX_WHITELIST, FilenameAffixError.BadChars),
16
+ // Stryker disable next-line StringLiteral
17
+ v.brand("FilenameAffix"));
@@ -1,10 +1,10 @@
1
- import * as z from "zod/v4";
1
+ import * as v from "valibot";
2
2
  export declare const FilenameFromStringError: {
3
3
  Type: string;
4
4
  Invalid: string;
5
5
  };
6
- export declare const FilenameFromString: z.ZodPipe<z.ZodString, z.ZodTransform<{
7
- basename: string & z.core.$brand<"Basename">;
8
- extension: string & z.core.$brand<"Extension">;
9
- }, string>>;
10
- export type FilenameFromStringType = z.infer<typeof FilenameFromString>;
6
+ export declare const FilenameFromString: v.SchemaWithPipe<readonly [v.StringSchema<string>, v.RegexAction<string, string>, v.TransformAction<string, {
7
+ basename: string & v.Brand<"Basename">;
8
+ extension: string & v.Brand<"Extension">;
9
+ }>]>;
10
+ export type FilenameFromStringType = v.InferOutput<typeof FilenameFromString>;
@@ -1,4 +1,4 @@
1
- import * as z from "zod/v4";
1
+ import * as v from "valibot";
2
2
  import { Basename } from "./basename.vo";
3
3
  import { Extension } from "./extension.vo";
4
4
  export const FilenameFromStringError = {
@@ -9,12 +9,9 @@ export const FilenameFromStringError = {
9
9
  // .
10
10
  // .+ at least one character
11
11
  const DOT_WITH_SIDES = /^.+\..+$/;
12
- export const FilenameFromString = z
13
- .string(FilenameFromStringError.Type)
14
- .regex(DOT_WITH_SIDES, FilenameFromStringError.Invalid)
15
- .transform((value) => {
12
+ export const FilenameFromString = v.pipe(v.string(FilenameFromStringError.Type), v.regex(DOT_WITH_SIDES, FilenameFromStringError.Invalid), v.transform((value) => {
16
13
  const index = value.lastIndexOf(".");
17
- const basename = Basename.parse(value.slice(0, index));
18
- const extension = Extension.parse(value.slice(index + 1));
14
+ const basename = v.parse(Basename, value.slice(0, index));
15
+ const extension = v.parse(Extension, value.slice(index + 1));
19
16
  return { basename, extension };
20
- });
17
+ }));
@@ -1,3 +1,4 @@
1
+ import * as v from "valibot";
1
2
  import { Basename } from "./basename.vo";
2
3
  import { Extension } from "./extension.vo";
3
4
  import { FilenameAffix, FilenameAffixStrategy } from "./filename-affix.vo";
@@ -10,13 +11,13 @@ export class Filename {
10
11
  this.extension = extension;
11
12
  }
12
13
  static fromParts(basename, extension) {
13
- return new Filename(Basename.parse(basename), Extension.parse(extension));
14
+ return new Filename(v.parse(Basename, basename), v.parse(Extension, extension));
14
15
  }
15
16
  static fromPartsSafe(basename, extension) {
16
17
  return new Filename(basename, extension);
17
18
  }
18
19
  static fromString(candidate) {
19
- const filename = FilenameFromString.parse(candidate);
20
+ const filename = v.parse(FilenameFromString, candidate);
20
21
  return new Filename(filename.basename, filename.extension);
21
22
  }
22
23
  get() {
@@ -35,17 +36,17 @@ export class Filename {
35
36
  return new Filename(basename, this.extension);
36
37
  }
37
38
  withAffix(candidate, strategy) {
38
- const affix = FilenameAffix.parse(candidate);
39
+ const affix = v.parse(FilenameAffix, candidate);
39
40
  if (strategy === FilenameAffixStrategy.prefix) {
40
- return new Filename(Basename.parse(`${affix}${this.basename}`), this.extension);
41
+ return new Filename(v.parse(Basename, `${affix}${this.basename}`), this.extension);
41
42
  }
42
- return new Filename(Basename.parse(`${this.basename}${affix}`), this.extension);
43
+ return new Filename(v.parse(Basename, `${this.basename}${affix}`), this.extension);
43
44
  }
44
45
  withAffixSafe(affix, strategy) {
45
46
  if (strategy === FilenameAffixStrategy.prefix) {
46
- return new Filename(Basename.parse(`${affix}${this.basename}`), this.extension);
47
+ return new Filename(v.parse(Basename, `${affix}${this.basename}`), this.extension);
47
48
  }
48
- return new Filename(Basename.parse(`${this.basename}${affix}`), this.extension);
49
+ return new Filename(v.parse(Basename, `${this.basename}${affix}`), this.extension);
49
50
  }
50
51
  withSuffix(candidate) {
51
52
  return this.withAffix(candidate, FilenameAffixStrategy.suffix);
@@ -1,7 +1,7 @@
1
- import * as z from "zod/v4";
1
+ import * as v from "valibot";
2
2
  export declare const HeightMillimetersError: {
3
3
  Type: string;
4
4
  Invalid: string;
5
5
  };
6
- export declare const HeightMillimeters: z.core.$ZodBranded<z.ZodNumber, "HeightMillimeters", "out">;
7
- export type HeightMillimetersType = z.infer<typeof HeightMillimeters>;
6
+ export declare const HeightMillimeters: v.SchemaWithPipe<readonly [v.NumberSchema<string>, v.IntegerAction<number, string>, v.MinValueAction<number, 0, string>, v.BrandAction<number, "HeightMillimeters">]>;
7
+ export type HeightMillimetersType = v.InferOutput<typeof HeightMillimeters>;
@@ -1,12 +1,8 @@
1
- import * as z from "zod/v4";
1
+ import * as v from "valibot";
2
2
  export const HeightMillimetersError = {
3
3
  Type: "height.millimeters.type",
4
4
  Invalid: "height.millimeters.invalid",
5
5
  };
6
- // Stryker disable all
7
- export const HeightMillimeters = z
8
- // Stryker restore all
9
- .number(HeightMillimetersError.Type)
10
- .int(HeightMillimetersError.Type)
11
- .min(0, HeightMillimetersError.Invalid)
12
- .brand("HeightMillimeters");
6
+ export const HeightMillimeters = v.pipe(v.number(HeightMillimetersError.Type), v.integer(HeightMillimetersError.Type), v.minValue(0, HeightMillimetersError.Invalid),
7
+ // Stryker disable next-line StringLiteral
8
+ v.brand("HeightMillimeters"));
package/dist/height.vo.js CHANGED
@@ -1,21 +1,22 @@
1
+ import * as v from "valibot";
1
2
  import { HeightMillimeters } from "./height-milimiters.vo";
2
3
  import { RoundingToNearestStrategy } from "./rounding-to-nearest.strategy";
3
4
  export class Height {
4
5
  millimeters;
5
- static ZERO = HeightMillimeters.parse(0);
6
+ static ZERO = v.parse(HeightMillimeters, 0);
6
7
  static MILLIMETERS_PER_CENTIMETER = 10;
7
8
  constructor(millimeters) {
8
9
  this.millimeters = millimeters;
9
10
  }
10
11
  static fromMillimeters(millimeters) {
11
- return new Height(HeightMillimeters.parse(millimeters));
12
+ return new Height(v.parse(HeightMillimeters, millimeters));
12
13
  }
13
14
  static fromMillimetersSafe(millimeters) {
14
15
  return new Height(millimeters);
15
16
  }
16
17
  static fromCentimeters(centimeters, rounding = new RoundingToNearestStrategy()) {
17
18
  const millimeters = rounding.round(centimeters * Height.MILLIMETERS_PER_CENTIMETER);
18
- return new Height(HeightMillimeters.parse(millimeters));
19
+ return new Height(v.parse(HeightMillimeters, millimeters));
19
20
  }
20
21
  static zero() {
21
22
  return Height.fromMillimetersSafe(Height.ZERO);
@@ -1,7 +1,7 @@
1
- import * as z from "zod/v4";
1
+ import * as v from "valibot";
2
2
  export declare const HourValueError: {
3
3
  Type: string;
4
4
  Invalid: string;
5
5
  };
6
- export declare const HourValue: z.core.$ZodBranded<z.ZodNumber, "HourSchema", "out">;
7
- export type HourValueType = z.infer<typeof HourValue>;
6
+ export declare const HourValue: v.SchemaWithPipe<readonly [v.NumberSchema<string>, v.IntegerAction<number, string>, v.MinValueAction<number, 0, string>, v.MaxValueAction<number, 23, string>, v.BrandAction<number, "HourSchema">]>;
7
+ export type HourValueType = v.InferOutput<typeof HourValue>;
@@ -1,10 +1,5 @@
1
- import * as z from "zod/v4";
1
+ import * as v from "valibot";
2
2
  export const HourValueError = { Type: "hour.value.type", Invalid: "hour.value.invalid" };
3
- // Stryker disable all
4
- export const HourValue = z
5
- // Stryker restore all
6
- .number(HourValueError.Type)
7
- .int(HourValueError.Type)
8
- .gte(0, HourValueError.Invalid)
9
- .lte(23, HourValueError.Invalid)
10
- .brand("HourSchema");
3
+ export const HourValue = v.pipe(v.number(HourValueError.Type), v.integer(HourValueError.Type), v.minValue(0, HourValueError.Invalid), v.maxValue(23, HourValueError.Invalid),
4
+ // Stryker disable next-line StringLiteral
5
+ v.brand("HourSchema"));
package/dist/hour.vo.js CHANGED
@@ -1,3 +1,4 @@
1
+ import * as v from "valibot";
1
2
  import { HourValue } from "./hour-value.vo";
2
3
  import { Timestamp } from "./timestamp.vo";
3
4
  export class Hour {
@@ -6,13 +7,13 @@ export class Hour {
6
7
  this.value = value;
7
8
  }
8
9
  static fromValue(candidate) {
9
- return new Hour(HourValue.parse(candidate));
10
+ return new Hour(v.parse(HourValue, candidate));
10
11
  }
11
12
  static fromValueSafe(candidate) {
12
13
  return new Hour(candidate);
13
14
  }
14
15
  static fromTimestamp(timestamp) {
15
- return new Hour(HourValue.parse(new Date(timestamp.ms).getUTCHours()));
16
+ return new Hour(v.parse(HourValue, new Date(timestamp.ms).getUTCHours()));
16
17
  }
17
18
  static fromTimestampValue(timestamp) {
18
19
  return Hour.fromTimestamp(Timestamp.fromValue(timestamp));
@@ -1,7 +1,7 @@
1
- import * as z from "zod/v4";
1
+ import * as v from "valibot";
2
2
  export declare const IbanSchemaError: {
3
3
  Type: string;
4
4
  Invalid: string;
5
5
  };
6
- export declare const IbanSchema: z.core.$ZodBranded<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, "IbanSchema", "out">;
7
- export type IbanSchemaType = z.infer<typeof IbanSchema>;
6
+ export declare const IbanSchema: v.SchemaWithPipe<readonly [v.StringSchema<string>, v.ToUpperCaseAction, v.TransformAction<string, string>, v.CheckAction<string, string>, v.BrandAction<string, "IbanSchema">]>;
7
+ export type IbanSchemaType = v.InferOutput<typeof IbanSchema>;
@@ -1,12 +1,7 @@
1
- import * as z from "zod/v4";
1
+ import * as v from "valibot";
2
2
  export const IbanSchemaError = { Type: "iban.schema.type", Invalid: "iban.schema.invalid" };
3
3
  // Two letters for country code, two digits, 11–30 uppercase letters or digits
4
4
  const IBAN_CHARS_WHITELIST = /^[A-Z]{2}[0-9]{2}[A-Z0-9]{11,30}$/;
5
- // Stryker disable all
6
- export const IbanSchema = z
7
- // Stryker restore all
8
- .string(IbanSchemaError.Type)
9
- .toUpperCase()
10
- .transform((value) => value.replaceAll(" ", ""))
11
- .refine((value) => IBAN_CHARS_WHITELIST.test(value), IbanSchemaError.Invalid)
12
- .brand("IbanSchema");
5
+ export const IbanSchema = v.pipe(v.string(IbanSchemaError.Type), v.toUpperCase(), v.transform((value) => value.replaceAll(" ", "")), v.check((value) => IBAN_CHARS_WHITELIST.test(value), IbanSchemaError.Invalid),
6
+ // Stryker disable next-line StringLiteral
7
+ v.brand("IbanSchema"));
package/dist/iban.vo.js CHANGED
@@ -1,8 +1,9 @@
1
+ import * as v from "valibot";
1
2
  import { IbanSchema } from "./iban-schema.vo";
2
3
  export class IBAN {
3
4
  value;
4
5
  constructor(candidate) {
5
- this.value = IbanSchema.parse(candidate);
6
+ this.value = v.parse(IbanSchema, candidate);
6
7
  }
7
8
  toString() {
8
9
  return this.value;
@@ -1,4 +1,4 @@
1
- import * as z from "zod/v4";
1
+ import * as v from "valibot";
2
2
  export declare const ImageWidthError: {
3
3
  Type: string;
4
4
  Length: string;
@@ -7,7 +7,7 @@ export declare const ImageHeightError: {
7
7
  Type: string;
8
8
  Length: string;
9
9
  };
10
- export declare const ImageWidth: z.core.$ZodBranded<z.ZodNumber, "ImageWidth", "out">;
11
- export type ImageWidthType = z.infer<typeof ImageWidth>;
12
- export declare const ImageHeight: z.core.$ZodBranded<z.ZodNumber, "ImageHeight", "out">;
13
- export type ImageHeightType = z.infer<typeof ImageHeight>;
10
+ export declare const ImageWidth: v.SchemaWithPipe<readonly [v.NumberSchema<string>, v.IntegerAction<number, string>, v.MinValueAction<number, number, string>, v.MaxValueAction<number, number, string>, v.BrandAction<number, "ImageWidth">]>;
11
+ export type ImageWidthType = v.InferOutput<typeof ImageWidth>;
12
+ export declare const ImageHeight: v.SchemaWithPipe<readonly [v.NumberSchema<string>, v.IntegerAction<number, string>, v.MinValueAction<number, number, string>, v.MaxValueAction<number, number, string>, v.BrandAction<number, "ImageHeight">]>;
13
+ export type ImageHeightType = v.InferOutput<typeof ImageHeight>;
package/dist/image.vo.js CHANGED
@@ -1,20 +1,10 @@
1
- import * as z from "zod/v4";
1
+ import * as v from "valibot";
2
2
  export const ImageWidthError = { Type: "image.width.type", Length: "image.width.length" };
3
3
  export const ImageHeightError = { Type: "image.height.type", Length: "image.height.length" };
4
4
  const IMAGE_DIMENSIONS_CONSTRAINTS = { min: 1, max: 10_000 };
5
- // Stryker disable all
6
- export const ImageWidth = z
7
- // Stryker restore all
8
- .number(ImageWidthError.Type)
9
- .int(ImageWidthError.Type)
10
- .min(IMAGE_DIMENSIONS_CONSTRAINTS.min, ImageWidthError.Length)
11
- .max(IMAGE_DIMENSIONS_CONSTRAINTS.max, ImageWidthError.Length)
12
- .brand("ImageWidth");
13
- // Stryker disable all
14
- export const ImageHeight = z
15
- // Stryker restore all
16
- .number(ImageHeightError.Type)
17
- .int(ImageHeightError.Type)
18
- .min(IMAGE_DIMENSIONS_CONSTRAINTS.min, ImageHeightError.Length)
19
- .max(IMAGE_DIMENSIONS_CONSTRAINTS.max, ImageHeightError.Length)
20
- .brand("ImageHeight");
5
+ export const ImageWidth = v.pipe(v.number(ImageWidthError.Type), v.integer(ImageWidthError.Type), v.minValue(IMAGE_DIMENSIONS_CONSTRAINTS.min, ImageWidthError.Length), v.maxValue(IMAGE_DIMENSIONS_CONSTRAINTS.max, ImageWidthError.Length),
6
+ // Stryker disable next-line StringLiteral
7
+ v.brand("ImageWidth"));
8
+ export const ImageHeight = v.pipe(v.number(ImageHeightError.Type), v.integer(ImageHeightError.Type), v.minValue(IMAGE_DIMENSIONS_CONSTRAINTS.min, ImageHeightError.Length), v.maxValue(IMAGE_DIMENSIONS_CONSTRAINTS.max, ImageHeightError.Length),
9
+ // Stryker disable next-line StringLiteral
10
+ v.brand("ImageHeight"));
@@ -1,7 +1,7 @@
1
- import * as z from "zod/v4";
1
+ import * as v from "valibot";
2
2
  export declare const IntegerNonNegativeError: {
3
3
  Type: string;
4
4
  Invalid: string;
5
5
  };
6
- export declare const IntegerNonNegative: z.core.$ZodBranded<z.ZodNumber, "IntegerNonNegative", "out">;
7
- export type IntegerNonNegativeType = z.infer<typeof IntegerNonNegative>;
6
+ export declare const IntegerNonNegative: v.SchemaWithPipe<readonly [v.NumberSchema<string>, v.IntegerAction<number, string>, v.MinValueAction<number, 0, string>, v.BrandAction<number, "IntegerNonNegative">]>;
7
+ export type IntegerNonNegativeType = v.InferOutput<typeof IntegerNonNegative>;
@@ -1,12 +1,8 @@
1
- import * as z from "zod/v4";
1
+ import * as v from "valibot";
2
2
  export const IntegerNonNegativeError = {
3
3
  Type: "integer.non.negative.type",
4
4
  Invalid: "integer.non.negative.invalid",
5
5
  };
6
- // Stryker disable all
7
- export const IntegerNonNegative = z
8
- // Stryker restore all
9
- .number(IntegerNonNegativeError.Type)
10
- .int(IntegerNonNegativeError.Type)
11
- .min(0, IntegerNonNegativeError.Invalid)
12
- .brand("IntegerNonNegative");
6
+ export const IntegerNonNegative = v.pipe(v.number(IntegerNonNegativeError.Type), v.integer(IntegerNonNegativeError.Type), v.minValue(0, IntegerNonNegativeError.Invalid),
7
+ // Stryker disable next-line StringLiteral
8
+ v.brand("IntegerNonNegative"));
@@ -1,7 +1,7 @@
1
- import * as z from "zod/v4";
1
+ import * as v from "valibot";
2
2
  export declare const IntegerPositiveError: {
3
3
  Type: string;
4
4
  Invalid: string;
5
5
  };
6
- export declare const IntegerPositive: z.core.$ZodBranded<z.ZodNumber, "IntegerPositive", "out">;
7
- export type IntegerPositiveType = z.infer<typeof IntegerPositive>;
6
+ export declare const IntegerPositive: v.SchemaWithPipe<readonly [v.NumberSchema<string>, v.IntegerAction<number, string>, v.MinValueAction<number, 1, string>, v.BrandAction<number, "IntegerPositive">]>;
7
+ export type IntegerPositiveType = v.InferOutput<typeof IntegerPositive>;
@@ -1,9 +1,5 @@
1
- import * as z from "zod/v4";
1
+ import * as v from "valibot";
2
2
  export const IntegerPositiveError = { Type: "integer.positive.type", Invalid: "integer.positive.invalid" };
3
- // Stryker disable all
4
- export const IntegerPositive = z
5
- // Stryker restore all
6
- .number(IntegerPositiveError.Type)
7
- .int(IntegerPositiveError.Type)
8
- .min(1, IntegerPositiveError.Invalid)
9
- .brand("IntegerPositive");
3
+ export const IntegerPositive = v.pipe(v.number(IntegerPositiveError.Type), v.integer(IntegerPositiveError.Type), v.minValue(1, IntegerPositiveError.Invalid),
4
+ // Stryker disable next-line StringLiteral
5
+ v.brand("IntegerPositive"));
@@ -1,6 +1,6 @@
1
- import * as z from "zod/v4";
1
+ import * as v from "valibot";
2
2
  export declare const IntegerError: {
3
3
  Type: string;
4
4
  };
5
- export declare const Integer: z.core.$ZodBranded<z.ZodNumber, "Integer", "out">;
6
- export type IntegerType = z.infer<typeof Integer>;
5
+ export declare const Integer: v.SchemaWithPipe<readonly [v.NumberSchema<string>, v.IntegerAction<number, string>, v.BrandAction<number, "Integer">]>;
6
+ export type IntegerType = v.InferOutput<typeof Integer>;
@@ -1,4 +1,4 @@
1
- import * as z from "zod/v4";
1
+ import * as v from "valibot";
2
2
  export const IntegerError = { Type: "integer.type" };
3
- // Stryker disable all
4
- export const Integer = z.number(IntegerError.Type).int(IntegerError.Type).brand("Integer");
3
+ // Stryker disable next-line StringLiteral
4
+ export const Integer = v.pipe(v.number(IntegerError.Type), v.integer(IntegerError.Type), v.brand("Integer"));
@@ -1,7 +1,7 @@
1
- import * as z from "zod/v4";
1
+ import * as v from "valibot";
2
2
  export declare const LanguageError: {
3
3
  Type: string;
4
4
  BadChars: string;
5
5
  };
6
- export declare const Language: z.ZodString;
7
- export type LanguageType = z.infer<typeof Language>;
6
+ export declare const Language: v.SchemaWithPipe<readonly [v.StringSchema<string>, v.RegexAction<string, string>]>;
7
+ export type LanguageType = v.InferOutput<typeof Language>;
@@ -1,5 +1,5 @@
1
- import * as z from "zod/v4";
1
+ import * as v from "valibot";
2
2
  export const LanguageError = { Type: "language.type", BadChars: "language.bad.chars" };
3
3
  // Two lowercase letters
4
4
  const LANGUAGE_CHARS_WHITELIST = /^[a-z]{2}$/;
5
- export const Language = z.string(LanguageError.Type).regex(LANGUAGE_CHARS_WHITELIST, LanguageError.BadChars);
5
+ export const Language = v.pipe(v.string(LanguageError.Type), v.regex(LANGUAGE_CHARS_WHITELIST, LanguageError.BadChars));
@@ -1,6 +1,7 @@
1
- import * as z from "zod/v4";
1
+ import * as v from "valibot";
2
2
  export declare const MimeValueError: {
3
3
  Type: string;
4
4
  Invalid: string;
5
5
  };
6
- export declare const MimeValue: z.core.$ZodBranded<z.ZodString, "MimeValue", "out">;
6
+ export declare const MimeValue: v.SchemaWithPipe<readonly [v.StringSchema<string>, v.RegexAction<string, string>, v.BrandAction<string, "MimeValue">]>;
7
+ export type MimeValueType = v.InferOutput<typeof MimeValue>;
@@ -1,10 +1,7 @@
1
- import * as z from "zod/v4";
1
+ import * as v from "valibot";
2
2
  export const MimeValueError = { Type: "mime.value.type", Invalid: "mime.value.invalid" };
3
3
  // One to twenty four lowercase letters, asterisk or hyphen, forward slash, one to seventy two lowercase letters, digits, asterisk, hyphen, plus, dot or underscore
4
4
  const MIME_VALUE_CHARS_WHITELIST = /^[a-z*-]{1,24}\/[a-z0-9*+-_.]{1,72}$/;
5
- // Stryker disable all
6
- export const MimeValue = z
7
- // Stryker restore all
8
- .string(MimeValueError.Type)
9
- .regex(MIME_VALUE_CHARS_WHITELIST, MimeValueError.Invalid)
10
- .brand("MimeValue");
5
+ export const MimeValue = v.pipe(v.string(MimeValueError.Type), v.regex(MIME_VALUE_CHARS_WHITELIST, MimeValueError.Invalid),
6
+ // Stryker disable next-line StringLiteral
7
+ v.brand("MimeValue"));
package/dist/mime.vo.js CHANGED
@@ -1,3 +1,4 @@
1
+ import * as v from "valibot";
1
2
  import { MimeValue } from "./mime-value.vo";
2
3
  export class Mime {
3
4
  type;
@@ -7,7 +8,7 @@ export class Mime {
7
8
  this.subtype = subtype;
8
9
  }
9
10
  static fromString(candidate) {
10
- const value = MimeValue.parse(candidate.split(";")[0].trim());
11
+ const value = v.parse(MimeValue, candidate.split(";")[0].trim());
11
12
  const [type, subtype] = value.split("/");
12
13
  return new Mime(type, subtype);
13
14
  }
package/dist/mimes.js CHANGED
@@ -1,18 +1,19 @@
1
+ import * as v from "valibot";
1
2
  import { Extension } from "./extension.vo";
2
3
  import { Mime } from "./mime.vo";
3
4
  import { MimeRegistryEntry } from "./mime-registry-entry.vo";
4
5
  export const Mimes = {
5
- csv: new MimeRegistryEntry(Mime.fromString("text/csv"), [Extension.parse("csv")]),
6
+ csv: new MimeRegistryEntry(Mime.fromString("text/csv"), [v.parse(Extension, "csv")]),
6
7
  jpg: new MimeRegistryEntry(Mime.fromString("image/jpeg"), [
7
- Extension.parse("jpg"),
8
- Extension.parse("jpeg"),
8
+ v.parse(Extension, "jpg"),
9
+ v.parse(Extension, "jpeg"),
9
10
  ]),
10
- markdown: new MimeRegistryEntry(Mime.fromString("text/markdown"), [Extension.parse("md")]),
11
- mp4: new MimeRegistryEntry(Mime.fromString("video/mp4"), [Extension.parse("mp4")]),
12
- pdf: new MimeRegistryEntry(Mime.fromString("application/pdf"), [Extension.parse("pdf")]),
13
- png: new MimeRegistryEntry(Mime.fromString("image/png"), [Extension.parse("png")]),
14
- text: new MimeRegistryEntry(Mime.fromString("text/plain"), [Extension.parse("txt")]),
15
- webp: new MimeRegistryEntry(Mime.fromString("image/webp"), [Extension.parse("webp")]),
16
- wav: new MimeRegistryEntry(Mime.fromString("audio/wav"), [Extension.parse("wav")]),
17
- zip: new MimeRegistryEntry(Mime.fromString("application/zip"), [Extension.parse("zip")]),
11
+ markdown: new MimeRegistryEntry(Mime.fromString("text/markdown"), [v.parse(Extension, "md")]),
12
+ mp4: new MimeRegistryEntry(Mime.fromString("video/mp4"), [v.parse(Extension, "mp4")]),
13
+ pdf: new MimeRegistryEntry(Mime.fromString("application/pdf"), [v.parse(Extension, "pdf")]),
14
+ png: new MimeRegistryEntry(Mime.fromString("image/png"), [v.parse(Extension, "png")]),
15
+ text: new MimeRegistryEntry(Mime.fromString("text/plain"), [v.parse(Extension, "txt")]),
16
+ webp: new MimeRegistryEntry(Mime.fromString("image/webp"), [v.parse(Extension, "webp")]),
17
+ wav: new MimeRegistryEntry(Mime.fromString("audio/wav"), [v.parse(Extension, "wav")]),
18
+ zip: new MimeRegistryEntry(Mime.fromString("application/zip"), [v.parse(Extension, "zip")]),
18
19
  };
@@ -1,7 +1,7 @@
1
- import * as z from "zod/v4";
1
+ import * as v from "valibot";
2
2
  export declare const MinuteValueError: {
3
3
  Type: string;
4
4
  Invalid: string;
5
5
  };
6
- export declare const MinuteValue: z.core.$ZodBranded<z.ZodNumber, "MinuteValue", "out">;
7
- export type MinuteValueType = z.infer<typeof MinuteValue>;
6
+ export declare const MinuteValue: v.SchemaWithPipe<readonly [v.NumberSchema<string>, v.IntegerAction<number, string>, v.MinValueAction<number, 0, string>, v.MaxValueAction<number, 59, string>, v.BrandAction<number, "MinuteValue">]>;
7
+ export type MinuteValueType = v.InferOutput<typeof MinuteValue>;
@@ -1,10 +1,5 @@
1
- import * as z from "zod/v4";
1
+ import * as v from "valibot";
2
2
  export const MinuteValueError = { Type: "minute.value.type", Invalid: "minute.value.invalid" };
3
- // Stryker disable all
4
- export const MinuteValue = z
5
- // Stryker restore all
6
- .number(MinuteValueError.Type)
7
- .int(MinuteValueError.Type)
8
- .gte(0, MinuteValueError.Invalid)
9
- .lte(59, MinuteValueError.Invalid)
10
- .brand("MinuteValue");
3
+ export const MinuteValue = v.pipe(v.number(MinuteValueError.Type), v.integer(MinuteValueError.Type), v.minValue(0, MinuteValueError.Invalid), v.maxValue(59, MinuteValueError.Invalid),
4
+ // Stryker disable next-line StringLiteral
5
+ v.brand("MinuteValue"));
package/dist/minute.vo.js CHANGED
@@ -1,3 +1,4 @@
1
+ import * as v from "valibot";
1
2
  import { MinuteValue } from "./minute-value.vo";
2
3
  import { Timestamp } from "./timestamp.vo";
3
4
  export class Minute {
@@ -6,13 +7,13 @@ export class Minute {
6
7
  this.value = value;
7
8
  }
8
9
  static fromValue(candidate) {
9
- return new Minute(MinuteValue.parse(candidate));
10
+ return new Minute(v.parse(MinuteValue, candidate));
10
11
  }
11
12
  static fromValueSafe(candidate) {
12
13
  return new Minute(candidate);
13
14
  }
14
15
  static fromTimestamp(timestamp) {
15
- return new Minute(MinuteValue.parse(new Date(timestamp.ms).getUTCMinutes()));
16
+ return new Minute(v.parse(MinuteValue, new Date(timestamp.ms).getUTCMinutes()));
16
17
  }
17
18
  static fromTimestampValue(timestamp) {
18
19
  return Minute.fromTimestamp(Timestamp.fromValue(timestamp));