@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,7 +1,7 @@
1
- import * as z from "zod/v4";
1
+ import * as v from "valibot";
2
2
  export declare const MoneyAmountError: {
3
3
  Type: string;
4
4
  Invalid: string;
5
5
  };
6
- export declare const MoneyAmount: z.core.$ZodBranded<z.ZodNumber, "MoneyAmount", "out">;
7
- export type MoneyAmountType = z.infer<typeof MoneyAmount>;
6
+ export declare const MoneyAmount: v.SchemaWithPipe<readonly [v.NumberSchema<string>, v.IntegerAction<number, string>, v.MinValueAction<number, 0, string>, v.BrandAction<number, "MoneyAmount">]>;
7
+ export type MoneyAmountType = v.InferOutput<typeof MoneyAmount>;
@@ -1,9 +1,5 @@
1
- import * as z from "zod/v4";
1
+ import * as v from "valibot";
2
2
  export const MoneyAmountError = { Type: "money.amount.type", Invalid: "money.amount.invalid" };
3
- // Stryker disable all
4
- export const MoneyAmount = z
5
- // Stryker restore all
6
- .number(MoneyAmountError.Type)
7
- .int(MoneyAmountError.Type)
8
- .min(0, MoneyAmountError.Invalid)
9
- .brand("MoneyAmount");
3
+ export const MoneyAmount = v.pipe(v.number(MoneyAmountError.Type), v.integer(MoneyAmountError.Type), v.minValue(0, MoneyAmountError.Invalid),
4
+ // Stryker disable next-line StringLiteral
5
+ v.brand("MoneyAmount"));
package/dist/money.vo.js CHANGED
@@ -1,14 +1,15 @@
1
+ import * as v from "valibot";
1
2
  import { MoneyAmount } from "./money-amount.vo";
2
3
  import { RoundingToNearestStrategy } from "./rounding-to-nearest.strategy";
3
4
  export const MoneyError = { SubtractResultLessThanZero: "money.subtract.result.less.than.zero" };
4
5
  export class Money {
5
6
  amount;
6
- static ZERO = MoneyAmount.parse(0);
7
+ static ZERO = v.parse(MoneyAmount, 0);
7
8
  constructor(amount) {
8
9
  this.amount = amount;
9
10
  }
10
11
  static fromAmount(candidate) {
11
- return new Money(MoneyAmount.parse(candidate));
12
+ return new Money(v.parse(MoneyAmount, candidate));
12
13
  }
13
14
  static fromAmountSafe(candidate) {
14
15
  return new Money(candidate);
@@ -20,19 +21,19 @@ export class Money {
20
21
  return this.amount;
21
22
  }
22
23
  add(money) {
23
- return new Money(MoneyAmount.parse(this.amount + money.getAmount()));
24
+ return new Money(v.parse(MoneyAmount, this.amount + money.getAmount()));
24
25
  }
25
26
  multiply(factor, rounding = new RoundingToNearestStrategy()) {
26
- return new Money(MoneyAmount.parse(rounding.round(this.amount * factor)));
27
+ return new Money(v.parse(MoneyAmount, rounding.round(this.amount * factor)));
27
28
  }
28
29
  subtract(money) {
29
30
  const result = this.amount - money.getAmount();
30
31
  if (result < Money.ZERO)
31
32
  throw new Error(MoneyError.SubtractResultLessThanZero);
32
- return new Money(MoneyAmount.parse(result));
33
+ return new Money(v.parse(MoneyAmount, result));
33
34
  }
34
35
  divide(factor, rounding = new RoundingToNearestStrategy()) {
35
- return new Money(MoneyAmount.parse(rounding.round(this.amount / factor)));
36
+ return new Money(v.parse(MoneyAmount, rounding.round(this.amount / factor)));
36
37
  }
37
38
  equals(another) {
38
39
  return this.amount === another.getAmount();
@@ -1,8 +1,8 @@
1
- import * as z from "zod/v4";
1
+ import * as v from "valibot";
2
2
  export declare const MonthIsoIdError: {
3
3
  Type: string;
4
4
  BadChars: string;
5
5
  Invalid: string;
6
6
  };
7
- export declare const MonthIsoId: z.core.$ZodBranded<z.ZodString, "MonthIsoId", "out">;
8
- export type MonthIsoIdType = z.infer<typeof MonthIsoId>;
7
+ export declare const MonthIsoId: v.SchemaWithPipe<readonly [v.StringSchema<string>, v.RegexAction<string, string>, v.CheckAction<string, string>, v.BrandAction<string, "MonthIsoId">]>;
8
+ export type MonthIsoIdType = v.InferOutput<typeof MonthIsoId>;
@@ -1,4 +1,4 @@
1
- import * as z from "zod/v4";
1
+ import * as v from "valibot";
2
2
  export const MonthIsoIdError = {
3
3
  Type: "month.iso.id.type",
4
4
  BadChars: "month.iso.id.bad.chars",
@@ -6,13 +6,9 @@ export const MonthIsoIdError = {
6
6
  };
7
7
  // Four digits, hyphen, two digits
8
8
  const MONTH_ISO_ID_CHARS_WHITELIST = /^\d{4}-\d{2}$/;
9
- // Stryker disable all
10
- export const MonthIsoId = z
11
- // Stryker restore all
12
- .string(MonthIsoIdError.Type)
13
- .regex(MONTH_ISO_ID_CHARS_WHITELIST, MonthIsoIdError.BadChars)
14
- .refine((value) => {
9
+ export const MonthIsoId = v.pipe(v.string(MonthIsoIdError.Type), v.regex(MONTH_ISO_ID_CHARS_WHITELIST, MonthIsoIdError.BadChars), v.check((value) => {
15
10
  const month = value.split("-").map(Number)[1];
16
11
  return month >= 1 && month <= 12;
17
- }, MonthIsoIdError.Invalid)
18
- .brand("MonthIsoId");
12
+ }, MonthIsoIdError.Invalid),
13
+ // Stryker disable next-line StringLiteral
14
+ v.brand("MonthIsoId"));
package/dist/month.vo.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { endOfMonth, format, startOfMonth } from "date-fns";
2
+ import * as v from "valibot";
2
3
  import { DateRange } from "./date-range.vo";
3
4
  import { Integer } from "./integer.vo";
4
5
  import { MonthIsoId } from "./month-iso-id.vo";
@@ -16,18 +17,18 @@ export class Month extends DateRange {
16
17
  return Month.fromTimestamp(now);
17
18
  }
18
19
  static fromIsoId(iso) {
19
- const [year, month] = MonthIsoId.parse(iso).split("-").map(Number);
20
+ const [year, month] = v.parse(MonthIsoId, iso).split("-").map(Number);
20
21
  const reference = Timestamp.fromNumber(Date.UTC(year, month - 1, 1));
21
22
  return Month.fromTimestamp(reference);
22
23
  }
23
24
  toIsoId() {
24
- return MonthIsoId.parse(format(this.getStart().ms, "yyyy-MM"));
25
+ return v.parse(MonthIsoId, format(this.getStart().ms, "yyyy-MM"));
25
26
  }
26
27
  previous() {
27
- return this.shift(Integer.parse(-1));
28
+ return this.shift(v.parse(Integer, -1));
28
29
  }
29
30
  next() {
30
- return this.shift(Integer.parse(1));
31
+ return this.shift(v.parse(Integer, 1));
31
32
  }
32
33
  shift(count) {
33
34
  const start = new Date(this.getStart().ms);
@@ -1,7 +1,7 @@
1
- import * as z from "zod/v4";
1
+ import * as v from "valibot";
2
2
  export declare const MultiplicationFactorError: {
3
3
  Type: string;
4
4
  Invalid: string;
5
5
  };
6
- export declare const MultiplicationFactor: z.core.$ZodBranded<z.ZodNumber, "MultiplicationFactor", "out">;
7
- export type MultiplicationFactorType = z.infer<typeof MultiplicationFactor>;
6
+ export declare const MultiplicationFactor: v.SchemaWithPipe<readonly [v.NumberSchema<string>, v.MinValueAction<number, 0, string>, v.BrandAction<number, "MultiplicationFactor">]>;
7
+ export type MultiplicationFactorType = v.InferOutput<typeof MultiplicationFactor>;
@@ -1,11 +1,8 @@
1
- import * as z from "zod/v4";
1
+ import * as v from "valibot";
2
2
  export const MultiplicationFactorError = {
3
3
  Type: "multiplication.factor.type",
4
4
  Invalid: "multiplication.factor.invalid",
5
5
  };
6
- // Stryker disable all
7
- export const MultiplicationFactor = z
8
- // Stryker restore all
9
- .number(MultiplicationFactorError.Type)
10
- .min(0, MultiplicationFactorError.Invalid)
11
- .brand("MultiplicationFactor");
6
+ export const MultiplicationFactor = v.pipe(v.number(MultiplicationFactorError.Type), v.minValue(0, MultiplicationFactorError.Invalid),
7
+ // Stryker disable next-line StringLiteral
8
+ v.brand("MultiplicationFactor"));
@@ -1,4 +1,4 @@
1
- import * as z from "zod/v4";
1
+ import * as v from "valibot";
2
2
  export declare const ObjectKeyError: {
3
3
  Type: string;
4
4
  LeadingSlash: string;
@@ -7,5 +7,5 @@ export declare const ObjectKeyError: {
7
7
  BadChars: string;
8
8
  DotSegments: string;
9
9
  };
10
- export declare const ObjectKey: z.core.$ZodBranded<z.ZodString, "ObjectKey", "out">;
11
- export type ObjectKeyType = z.infer<typeof ObjectKey>;
10
+ export declare const ObjectKey: v.SchemaWithPipe<readonly [v.StringSchema<string>, v.MinLengthAction<string, 1, string>, v.MaxLengthAction<string, 256, string>, v.CheckAction<string, string>, v.CheckAction<string, string>, v.CheckAction<string, string>, v.BrandAction<string, "ObjectKey">]>;
11
+ export type ObjectKeyType = v.InferOutput<typeof ObjectKey>;
@@ -1,4 +1,4 @@
1
- import * as z from "zod/v4";
1
+ import * as v from "valibot";
2
2
  export const ObjectKeyError = {
3
3
  Type: "object.key.type",
4
4
  LeadingSlash: "object.key.leading.slash",
@@ -10,15 +10,10 @@ export const ObjectKeyError = {
10
10
  // Lowercase letters, digits, dots, underscores, and hyphens
11
11
  const OBJECT_KEY_SEGMENT_CHARS_WHITELIST = /^[a-z0-9._-]+$/;
12
12
  const DOT_SEGMENTS = [".", ".."];
13
- // Stryker disable all
14
- export const ObjectKey = z
15
- // Stryker restore all
16
- .string(ObjectKeyError.Type)
17
- .min(1, ObjectKeyError.Empty)
18
- .max(256, ObjectKeyError.TooLong)
19
- .refine((value) => !value.startsWith("/"), ObjectKeyError.LeadingSlash)
20
- // Allow only known characters for users/avatars/1234567890/avatar.png segments
21
- .refine((value) => value.split("/").every((segment) => OBJECT_KEY_SEGMENT_CHARS_WHITELIST.test(segment)), ObjectKeyError.BadChars)
22
- // Reject object keys like users/./avatar.png or users/../avatar.png
23
- .refine((value) => value.split("/").every((segment) => !DOT_SEGMENTS.includes(segment)), ObjectKeyError.DotSegments)
24
- .brand("ObjectKey");
13
+ export const ObjectKey = v.pipe(v.string(ObjectKeyError.Type), v.minLength(1, ObjectKeyError.Empty), v.maxLength(256, ObjectKeyError.TooLong), v.check((value) => !value.startsWith("/"), ObjectKeyError.LeadingSlash),
14
+ // Allow only known characters for users/avatars/1234567890/avatar.png segments
15
+ v.check((value) => value.split("/").every((segment) => OBJECT_KEY_SEGMENT_CHARS_WHITELIST.test(segment)), ObjectKeyError.BadChars),
16
+ // Reject object keys like users/./avatar.png or users/../avatar.png
17
+ v.check((value) => value.split("/").every((segment) => !DOT_SEGMENTS.includes(segment)), ObjectKeyError.DotSegments),
18
+ // Stryker disable next-line StringLiteral
19
+ v.brand("ObjectKey"));
@@ -1,8 +1,8 @@
1
- import * as z from "zod/v4";
1
+ import * as v from "valibot";
2
2
  export declare const PackageVersionSchemaError: {
3
3
  Type: string;
4
4
  BadChars: string;
5
5
  };
6
6
  export declare const PACKAGE_VERSIONS_CHARS_WHITELIST: RegExp;
7
- export declare const PackageVersionSchema: z.core.$ZodBranded<z.ZodString, "PackageVersionSchema", "out">;
8
- export type PackageVersionSchemaType = z.infer<typeof PackageVersionSchema>;
7
+ export declare const PackageVersionSchema: v.SchemaWithPipe<readonly [v.StringSchema<string>, v.RegexAction<string, string>, v.BrandAction<string, "PackageVersionSchema">]>;
8
+ export type PackageVersionSchemaType = v.InferOutput<typeof PackageVersionSchema>;
@@ -1,13 +1,10 @@
1
- import * as z from "zod/v4";
1
+ import * as v from "valibot";
2
2
  export const PackageVersionSchemaError = {
3
3
  Type: "package.version.schema.error",
4
4
  BadChars: "package.version.schema.bad.chars",
5
5
  };
6
6
  // v, 1-4 digits, dot, 1-4 digits, dot, 1-4 digits - () for capturing groups
7
7
  export const PACKAGE_VERSIONS_CHARS_WHITELIST = /^v([0-9]{1,4})\.([0-9]{1,4})\.([0-9]{1,4})$/;
8
- // Stryker disable all
9
- export const PackageVersionSchema = z
10
- // Stryker restore all
11
- .string(PackageVersionSchemaError.Type)
12
- .regex(PACKAGE_VERSIONS_CHARS_WHITELIST, PackageVersionSchemaError.BadChars)
13
- .brand("PackageVersionSchema");
8
+ export const PackageVersionSchema = v.pipe(v.string(PackageVersionSchemaError.Type), v.regex(PACKAGE_VERSIONS_CHARS_WHITELIST, PackageVersionSchemaError.BadChars),
9
+ // Stryker disable next-line StringLiteral
10
+ v.brand("PackageVersionSchema"));
@@ -1,3 +1,4 @@
1
+ import * as v from "valibot";
1
2
  import { PACKAGE_VERSIONS_CHARS_WHITELIST, PackageVersionSchema, } from "./package-version-schema.vo";
2
3
  export class PackageVersion {
3
4
  major;
@@ -9,16 +10,14 @@ export class PackageVersion {
9
10
  this.patch = patch;
10
11
  }
11
12
  static fromVersionString(candidate) {
12
- const version = PackageVersionSchema.parse(candidate);
13
- return PackageVersion.fromVersionStringSafe(version);
13
+ return PackageVersion.fromVersionStringSafe(v.parse(PackageVersionSchema, candidate));
14
14
  }
15
15
  static fromVersionStringSafe(candidate) {
16
16
  const [, major, minor, patch] = PACKAGE_VERSIONS_CHARS_WHITELIST.exec(candidate).map(Number);
17
17
  return new PackageVersion(major, minor, patch);
18
18
  }
19
19
  static fromString(candidate) {
20
- const version = PackageVersionSchema.parse(`v${candidate}`);
21
- return PackageVersion.fromVersionStringSafe(version);
20
+ return PackageVersion.fromVersionStringSafe(v.parse(PackageVersionSchema, `v${candidate}`));
22
21
  }
23
22
  compareTo(another) {
24
23
  if (this.major > another.major)
@@ -1,6 +1,6 @@
1
- import * as z from "zod/v4";
1
+ import * as v from "valibot";
2
2
  export declare const PaginationPageError: {
3
3
  Type: string;
4
4
  };
5
- export declare const Page: z.ZodDefault<z.ZodPipe<z.ZodCoercedNumber<unknown>, z.ZodTransform<number, number>>>;
6
- export type PageType = z.infer<typeof Page>;
5
+ export declare const Page: v.SchemaWithPipe<readonly [v.UnknownSchema, v.TransformAction<unknown, number>, v.NumberSchema<string>, v.IntegerAction<number, string>, v.TransformAction<number, number>]>;
6
+ export type PageType = v.InferOutput<typeof Page>;
@@ -1,7 +1,3 @@
1
- import * as z from "zod/v4";
1
+ import * as v from "valibot";
2
2
  export const PaginationPageError = { Type: "pagination.page.type" };
3
- export const Page = z.coerce
4
- .number(PaginationPageError.Type)
5
- .int(PaginationPageError.Type)
6
- .transform((value) => (value <= 0 ? 1 : value))
7
- .default(1);
3
+ export const Page = v.pipe(v.unknown(), v.transform((value) => (value === undefined ? 1 : Number(value))), v.number(PaginationPageError.Type), v.integer(PaginationPageError.Type), v.transform((value) => (value <= 0 ? 1 : value)));
@@ -1,7 +1,7 @@
1
- import * as z from "zod/v4";
1
+ import * as v from "valibot";
2
2
  export declare const PaginationSkipError: {
3
3
  Type: string;
4
4
  Invalid: string;
5
5
  };
6
- export declare const Skip: z.ZodNumber;
7
- export type SkipType = z.infer<typeof Skip>;
6
+ export declare const Skip: v.SchemaWithPipe<readonly [v.NumberSchema<string>, v.IntegerAction<number, string>, v.MinValueAction<number, 0, string>]>;
7
+ export type SkipType = v.InferOutput<typeof Skip>;
@@ -1,6 +1,3 @@
1
- import * as z from "zod/v4";
1
+ import * as v from "valibot";
2
2
  export const PaginationSkipError = { Type: "pagination.skip.type", Invalid: "pagination.skip.invalid" };
3
- export const Skip = z
4
- .number(PaginationSkipError.Type)
5
- .int(PaginationSkipError.Type)
6
- .gte(0, PaginationSkipError.Invalid);
3
+ export const Skip = v.pipe(v.number(PaginationSkipError.Type), v.integer(PaginationSkipError.Type), v.minValue(0, PaginationSkipError.Invalid));
@@ -1,7 +1,7 @@
1
- import * as z from "zod/v4";
1
+ import * as v from "valibot";
2
2
  export declare const PaginationTakeError: {
3
3
  Type: string;
4
4
  Invalid: string;
5
5
  };
6
- export declare const Take: z.ZodNumber;
7
- export type TakeType = z.infer<typeof Take>;
6
+ export declare const Take: v.SchemaWithPipe<readonly [v.NumberSchema<string>, v.IntegerAction<number, string>, v.MinValueAction<number, 1, string>]>;
7
+ export type TakeType = v.InferOutput<typeof Take>;
@@ -1,6 +1,3 @@
1
- import * as z from "zod/v4";
1
+ import * as v from "valibot";
2
2
  export const PaginationTakeError = { Type: "pagination.take.type", Invalid: "pagination.take.invalid" };
3
- export const Take = z
4
- .number(PaginationTakeError.Type)
5
- .int(PaginationTakeError.Type)
6
- .gte(1, PaginationTakeError.Invalid);
3
+ export const Take = v.pipe(v.number(PaginationTakeError.Type), v.integer(PaginationTakeError.Type), v.minValue(1, PaginationTakeError.Invalid));
@@ -1,20 +1,21 @@
1
+ import * as v from "valibot";
1
2
  import { Page } from "./pagination-page.vo";
2
3
  import { Skip } from "./pagination-skip.vo";
3
4
  import { Take } from "./pagination-take.vo";
4
5
  import { RoundingUpStrategy } from "./rounding-up.strategy";
5
6
  export class Pagination {
6
7
  static parse(values, _take) {
7
- const page = Page.parse(values.page);
8
- const take = Take.parse(_take);
9
- const skip = Skip.parse((page - 1) * take);
8
+ const page = v.parse(Page, values.page);
9
+ const take = v.parse(Take, _take);
10
+ const skip = v.parse(Skip, (page - 1) * take);
10
11
  return { values: { take, skip }, page };
11
12
  }
12
13
  static prepare(config) {
13
14
  const exhausted = Pagination.isExhausted(config);
14
15
  const currentPage = config.pagination.page;
15
16
  const lastPage = Pagination.getLastPage(config);
16
- const previousPage = currentPage > 1 ? Page.parse(currentPage - 1) : undefined;
17
- const nextPage = currentPage < lastPage ? Page.parse(currentPage + 1) : undefined;
17
+ const previousPage = currentPage > 1 ? v.parse(Page, currentPage - 1) : undefined;
18
+ const nextPage = currentPage < lastPage ? v.parse(Page, currentPage + 1) : undefined;
18
19
  return {
19
20
  result: config.result,
20
21
  meta: { exhausted, currentPage, previousPage, nextPage, lastPage, total: config.total },
@@ -24,7 +25,7 @@ export class Pagination {
24
25
  return Pagination.getLastPage(config) <= config.pagination.page;
25
26
  }
26
27
  static getLastPage(config) {
27
- return Page.parse(new RoundingUpStrategy().round(config.total / config.pagination.values.take));
28
+ return v.parse(Page, new RoundingUpStrategy().round(config.total / config.pagination.values.take));
28
29
  }
29
30
  static empty = {
30
31
  result: [],
@@ -38,6 +39,6 @@ export class Pagination {
38
39
  },
39
40
  };
40
41
  static getFirstPage(input) {
41
- return { values: { take: Take.parse(input.take), skip: Skip.parse(0) }, page: Page.parse(1) };
42
+ return { values: { take: v.parse(Take, input.take), skip: v.parse(Skip, 0) }, page: v.parse(Page, 1) };
42
43
  }
43
44
  }
@@ -1,7 +1,8 @@
1
- import * as z from "zod/v4";
1
+ import * as v from "valibot";
2
2
  export declare const QuarterIsoIdError: {
3
3
  Type: string;
4
4
  BadChars: string;
5
5
  };
6
- export declare const QuarterIsoId: z.core.$ZodBranded<z.ZodString, "QuarterIsoId", "out">;
7
- export type QuarterIsoIdType = z.infer<typeof QuarterIsoId>;
6
+ export declare const QUARTER_ISO_ID_CHARS_WHITELIST: RegExp;
7
+ export declare const QuarterIsoId: v.SchemaWithPipe<readonly [v.StringSchema<string>, v.RegexAction<string, string>, v.BrandAction<string, "QuarterIsoId">]>;
8
+ export type QuarterIsoIdType = v.InferOutput<typeof QuarterIsoId>;
@@ -1,11 +1,7 @@
1
- import * as z from "zod/v4";
2
- export const QuarterIsoIdError = {
3
- Type: "quarter.iso.id.type",
4
- BadChars: "quarter.iso.id.bad.chars",
5
- };
6
- // Stryker disable all
7
- export const QuarterIsoId = z
8
- // Stryker restore all
9
- .string(QuarterIsoIdError.Type)
10
- .regex(/^\d{4}-Q[1-4]$/, QuarterIsoIdError.BadChars)
11
- .brand("QuarterIsoId");
1
+ import * as v from "valibot";
2
+ export const QuarterIsoIdError = { Type: "quarter.iso.id.type", BadChars: "quarter.iso.id.bad.chars" };
3
+ // 4 digits, hyphen, Q, digits from 1 to 4
4
+ export const QUARTER_ISO_ID_CHARS_WHITELIST = /^\d{4}-Q[1-4]$/;
5
+ export const QuarterIsoId = v.pipe(v.string(QuarterIsoIdError.Type), v.regex(QUARTER_ISO_ID_CHARS_WHITELIST, QuarterIsoIdError.BadChars),
6
+ // Stryker disable next-line StringLiteral
7
+ v.brand("QuarterIsoId"));
@@ -1,4 +1,5 @@
1
1
  import { endOfQuarter, getQuarter, getYear, startOfQuarter } from "date-fns";
2
+ import * as v from "valibot";
2
3
  import { DateRange } from "./date-range.vo";
3
4
  import { QuarterIsoId } from "./quarter-iso-id.vo";
4
5
  import { Timestamp } from "./timestamp.vo";
@@ -15,13 +16,13 @@ export class Quarter extends DateRange {
15
16
  return Quarter.fromTimestamp(now);
16
17
  }
17
18
  static fromIsoId(isoId) {
18
- const [year, quarter] = QuarterIsoId.parse(isoId).split("-Q").map(Number);
19
+ const [year, quarter] = v.parse(QuarterIsoId, isoId).split("-Q").map(Number);
19
20
  return Quarter.fromTimestamp(Timestamp.fromNumber(Date.UTC(year, (quarter - 1) * 3, 1)));
20
21
  }
21
22
  toIsoId() {
22
23
  const year = getYear(this.getStart().ms);
23
24
  const quarter = getQuarter(this.getStart().ms);
24
- return QuarterIsoId.parse(`${year}-Q${quarter}`);
25
+ return v.parse(QuarterIsoId, `${year}-Q${quarter}`);
25
26
  }
26
27
  toString() {
27
28
  return this.toIsoId();
@@ -1,6 +1,6 @@
1
- import * as z from "zod/v4";
1
+ import * as v from "valibot";
2
2
  export declare const ReorderingItemPositionValueError: {
3
3
  Invalid: string;
4
4
  };
5
- export declare const ReorderingItemPositionValue: z.ZodNumber;
6
- export type ReorderingItemPositionValueType = z.infer<typeof ReorderingItemPositionValue>;
5
+ export declare const ReorderingItemPositionValue: v.SchemaWithPipe<readonly [v.NumberSchema<string>, v.IntegerAction<number, string>, v.MinValueAction<number, 0, string>]>;
6
+ export type ReorderingItemPositionValueType = v.InferOutput<typeof ReorderingItemPositionValue>;
@@ -1,6 +1,3 @@
1
- import * as z from "zod/v4";
1
+ import * as v from "valibot";
2
2
  export const ReorderingItemPositionValueError = { Invalid: "reordering.position.type" };
3
- export const ReorderingItemPositionValue = z
4
- .number(ReorderingItemPositionValueError.Invalid)
5
- .int(ReorderingItemPositionValueError.Invalid)
6
- .min(0, ReorderingItemPositionValueError.Invalid);
3
+ export const ReorderingItemPositionValue = v.pipe(v.number(ReorderingItemPositionValueError.Invalid), v.integer(ReorderingItemPositionValueError.Invalid), v.minValue(0, ReorderingItemPositionValueError.Invalid));
@@ -1,18 +1,18 @@
1
- import * as z from "zod/v4";
1
+ import * as v from "valibot";
2
2
  import { type ReorderingItemPositionValueType } from "./reordering-item-position-value.vo";
3
3
  export declare const ReorderingError: {
4
4
  CannotFindItem: string;
5
5
  CannotFindCurrent: string;
6
6
  CannotFindTarget: string;
7
7
  };
8
- export declare const ReorderingId: z.ZodString;
9
- export type ReorderingItemIdType = z.infer<typeof ReorderingId>;
10
- export declare const Reordering: z.ZodObject<{
11
- correlationId: z.ZodString;
12
- id: z.ZodString;
13
- position: z.ZodNumber;
14
- }, z.core.$strip>;
15
- export type ReorderingType = z.infer<typeof Reordering>;
8
+ export declare const ReorderingId: v.SchemaWithPipe<readonly [v.StringSchema<string>, v.MinLengthAction<string, 1, string>]>;
9
+ export type ReorderingItemIdType = v.InferOutput<typeof ReorderingId>;
10
+ export declare const Reordering: v.ObjectSchema<{
11
+ readonly correlationId: v.SchemaWithPipe<readonly [v.StringSchema<string>, v.MinLengthAction<string, 1, string>]>;
12
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<string>, v.MinLengthAction<string, 1, string>]>;
13
+ readonly position: v.SchemaWithPipe<readonly [v.NumberSchema<string>, v.IntegerAction<number, string>, v.MinValueAction<number, 0, string>]>;
14
+ }, undefined>;
15
+ export type ReorderingType = v.InferOutput<typeof Reordering>;
16
16
  export type WithReorderingPositionValue<T> = T & {
17
17
  position: ReorderingItemPositionValueType;
18
18
  };
@@ -1,5 +1,5 @@
1
1
  // Stryker disable all
2
- import * as z from "zod/v4";
2
+ import * as v from "valibot";
3
3
  import { DoublyLinkedList, Node } from "./dll.service";
4
4
  import { ReorderingItemPositionValue, } from "./reordering-item-position-value.vo";
5
5
  export const ReorderingError = {
@@ -8,8 +8,8 @@ export const ReorderingError = {
8
8
  CannotFindTarget: "reordering.cannot.find.target",
9
9
  };
10
10
  const ReorderingIdError = { Type: "reordering.id.type" };
11
- export const ReorderingId = z.string(ReorderingIdError.Type).min(1, ReorderingIdError.Type);
12
- export const Reordering = z.object({
11
+ export const ReorderingId = v.pipe(v.string(ReorderingIdError.Type), v.minLength(1, ReorderingIdError.Type));
12
+ export const Reordering = v.object({
13
13
  correlationId: ReorderingId,
14
14
  id: ReorderingId,
15
15
  position: ReorderingItemPositionValue,
@@ -17,7 +17,7 @@ export const Reordering = z.object({
17
17
  export class ReorderingPosition {
18
18
  value;
19
19
  constructor(value) {
20
- this.value = ReorderingItemPositionValue.parse(value);
20
+ this.value = v.parse(ReorderingItemPositionValue, value);
21
21
  }
22
22
  eq(another) {
23
23
  return this.value === another.value;
@@ -71,7 +71,7 @@ export class ReorderingCalculator {
71
71
  }
72
72
  add(id) {
73
73
  const size = this.dll.getSize();
74
- const position = new ReorderingPosition(ReorderingItemPositionValue.parse(size));
74
+ const position = new ReorderingPosition(v.parse(ReorderingItemPositionValue, size));
75
75
  const item = new ReorderingItem(id, position);
76
76
  const node = new Node(item);
77
77
  this.dll.append(node);
@@ -114,7 +114,7 @@ export class ReorderingCalculator {
114
114
  let index = 0;
115
115
  for (const node of this.dll) {
116
116
  const id = node.data.id;
117
- const position = new ReorderingPosition(ReorderingItemPositionValue.parse(index));
117
+ const position = new ReorderingPosition(v.parse(ReorderingItemPositionValue, index));
118
118
  node.data = new ReorderingItem(id, position);
119
119
  index += 1;
120
120
  }
@@ -124,7 +124,7 @@ export class ReorderingIntegrator {
124
124
  static appendPosition(reordering) {
125
125
  return function (item) {
126
126
  const found = reordering.find((x) => x.id === item.id);
127
- const positionValue = ReorderingItemPositionValue.parse(found?.position ?? 0);
127
+ const positionValue = v.parse(ReorderingItemPositionValue, found?.position ?? 0);
128
128
  return { ...item, position: positionValue };
129
129
  };
130
130
  }
@@ -1,7 +1,7 @@
1
- import * as z from "zod/v4";
1
+ import * as v from "valibot";
2
2
  export declare const RevisionValueError: {
3
3
  Type: string;
4
4
  Invalid: string;
5
5
  };
6
- export declare const RevisionValue: z.ZodNumber;
7
- export type RevisionValueType = z.infer<typeof RevisionValue>;
6
+ export declare const RevisionValue: v.SchemaWithPipe<readonly [v.NumberSchema<string>, v.IntegerAction<number, string>, v.MinValueAction<number, 0, string>]>;
7
+ export type RevisionValueType = v.InferOutput<typeof RevisionValue>;
@@ -1,6 +1,3 @@
1
- import * as z from "zod/v4";
1
+ import * as v from "valibot";
2
2
  export const RevisionValueError = { Type: "revision.value.type", Invalid: "revision.value.invalid" };
3
- export const RevisionValue = z
4
- .number(RevisionValueError.Type)
5
- .int(RevisionValueError.Type)
6
- .min(0, RevisionValueError.Invalid);
3
+ export const RevisionValue = v.pipe(v.number(RevisionValueError.Type), v.integer(RevisionValueError.Type), v.minValue(0, RevisionValueError.Invalid));
@@ -1,10 +1,11 @@
1
+ import * as v from "valibot";
1
2
  import { RevisionValue } from "./revision-value.vo";
2
3
  export const RevisionError = { Missing: "revision.missing", Mismatch: "revision.mismatch" };
3
4
  export class Revision {
4
- static INITIAL = RevisionValue.parse(0);
5
+ static INITIAL = v.parse(RevisionValue, 0);
5
6
  value;
6
7
  constructor(value) {
7
- this.value = RevisionValue.parse(value);
8
+ this.value = v.parse(RevisionValue, value);
8
9
  }
9
10
  equals(another) {
10
11
  return this.value === another;
@@ -1,10 +1,10 @@
1
- import * as z from "zod/v4";
1
+ import * as v from "valibot";
2
2
  import type { RoundingStrategy } from "./rounding.strategy";
3
3
  export declare const RoundingDecimalError: {
4
4
  Type: string;
5
5
  Invalid: string;
6
6
  };
7
- export declare const RoundingDecimal: z.core.$ZodBranded<z.ZodNumber, "RoundingDecimal", "out">;
7
+ export declare const RoundingDecimal: v.SchemaWithPipe<readonly [v.NumberSchema<string>, v.IntegerAction<number, string>, v.MinValueAction<number, 1, string>, v.MaxValueAction<number, 100, string>, v.BrandAction<number, "RoundingDecimal">]>;
8
8
  export declare class RoundingDecimalStrategy implements RoundingStrategy {
9
9
  private readonly decimals;
10
10
  constructor(candidate: number);
@@ -1,17 +1,12 @@
1
- import * as z from "zod/v4";
1
+ import * as v from "valibot";
2
2
  export const RoundingDecimalError = { Type: "rounding.decimal.type", Invalid: "rounding.decimal.invalid" };
3
- // Stryker disable all
4
- export const RoundingDecimal = z
5
- // Stryker restore all
6
- .number(RoundingDecimalError.Type)
7
- .int(RoundingDecimalError.Invalid)
8
- .min(1, RoundingDecimalError.Invalid)
9
- .max(100, RoundingDecimalError.Invalid)
10
- .brand("RoundingDecimal");
3
+ export const RoundingDecimal = v.pipe(v.number(RoundingDecimalError.Type), v.integer(RoundingDecimalError.Invalid), v.minValue(1, RoundingDecimalError.Invalid), v.maxValue(100, RoundingDecimalError.Invalid),
4
+ // Stryker disable next-line StringLiteral
5
+ v.brand("RoundingDecimal"));
11
6
  export class RoundingDecimalStrategy {
12
7
  decimals;
13
8
  constructor(candidate) {
14
- this.decimals = RoundingDecimal.parse(candidate);
9
+ this.decimals = v.parse(RoundingDecimal, candidate);
15
10
  }
16
11
  round(value) {
17
12
  return Number.parseFloat(value.toFixed(this.decimals));