@bgord/tools 1.2.21 → 1.3.0

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 (107) hide show
  1. package/dist/age-years.vo.d.ts +1 -1
  2. package/dist/age-years.vo.js +1 -1
  3. package/dist/api-key.vo.d.ts +1 -1
  4. package/dist/api-key.vo.js +1 -1
  5. package/dist/basename.vo.d.ts +1 -1
  6. package/dist/basename.vo.js +1 -1
  7. package/dist/day-iso-id.vo.d.ts +1 -1
  8. package/dist/day-iso-id.vo.js +1 -1
  9. package/dist/directory-path-absolute.vo.d.ts +1 -1
  10. package/dist/directory-path-absolute.vo.js +1 -1
  11. package/dist/directory-path-relative.vo.d.ts +1 -1
  12. package/dist/directory-path-relative.vo.js +1 -1
  13. package/dist/distance-value.vo.d.ts +1 -1
  14. package/dist/distance-value.vo.js +1 -1
  15. package/dist/division-factor.vo.d.ts +1 -1
  16. package/dist/division-factor.vo.js +1 -1
  17. package/dist/duration-ms.vo.d.ts +1 -1
  18. package/dist/duration-ms.vo.js +1 -1
  19. package/dist/email.vo.d.ts +1 -1
  20. package/dist/email.vo.js +1 -1
  21. package/dist/extension.vo.d.ts +1 -1
  22. package/dist/extension.vo.js +1 -1
  23. package/dist/feature-flag-value.vo.d.ts +1 -1
  24. package/dist/feature-flag-value.vo.js +1 -1
  25. package/dist/file-path-absolute-schema.vo.d.ts +1 -1
  26. package/dist/file-path-absolute-schema.vo.js +1 -1
  27. package/dist/file-path-relative-schema.vo.d.ts +1 -1
  28. package/dist/file-path-relative-schema.vo.js +1 -1
  29. package/dist/filename-affix.vo.d.ts +1 -1
  30. package/dist/filename-affix.vo.js +1 -1
  31. package/dist/filename-from-string.vo.d.ts +1 -1
  32. package/dist/filename-from-string.vo.js +1 -1
  33. package/dist/filename.vo.d.ts +0 -2
  34. package/dist/filename.vo.js +0 -4
  35. package/dist/height-milimiters.vo.d.ts +1 -1
  36. package/dist/height-milimiters.vo.js +1 -1
  37. package/dist/hour-schema.vo.d.ts +1 -1
  38. package/dist/hour-schema.vo.js +1 -1
  39. package/dist/iban-schema.vo.d.ts +1 -1
  40. package/dist/iban-schema.vo.js +1 -1
  41. package/dist/image.vo.d.ts +1 -1
  42. package/dist/image.vo.js +1 -1
  43. package/dist/index.d.ts +1 -0
  44. package/dist/index.js +1 -0
  45. package/dist/integer-non-negative.vo.d.ts +1 -1
  46. package/dist/integer-non-negative.vo.js +1 -1
  47. package/dist/integer-positive.vo.d.ts +1 -1
  48. package/dist/integer-positive.vo.js +1 -1
  49. package/dist/integer.vo.d.ts +1 -1
  50. package/dist/integer.vo.js +1 -1
  51. package/dist/language.vo.d.ts +1 -1
  52. package/dist/language.vo.js +1 -1
  53. package/dist/mime-registry.service.d.ts +13 -0
  54. package/dist/mime-registry.service.js +19 -0
  55. package/dist/mime-value.vo.d.ts +1 -1
  56. package/dist/mime-value.vo.js +1 -1
  57. package/dist/mime.vo.d.ts +0 -3
  58. package/dist/mime.vo.js +0 -8
  59. package/dist/minute-schema.vo.d.ts +1 -1
  60. package/dist/minute-schema.vo.js +1 -1
  61. package/dist/money-amount.vo.d.ts +1 -1
  62. package/dist/money-amount.vo.js +1 -1
  63. package/dist/month-iso-id.vo.d.ts +1 -1
  64. package/dist/month-iso-id.vo.js +1 -1
  65. package/dist/multiplication-factor.vo.d.ts +1 -1
  66. package/dist/multiplication-factor.vo.js +1 -1
  67. package/dist/object-key.vo.d.ts +1 -1
  68. package/dist/object-key.vo.js +1 -1
  69. package/dist/package-version-schema.vo.d.ts +1 -1
  70. package/dist/package-version-schema.vo.js +1 -1
  71. package/dist/pagination-page.vo.d.ts +1 -1
  72. package/dist/pagination-page.vo.js +1 -1
  73. package/dist/pagination-skip.vo.d.ts +1 -1
  74. package/dist/pagination-skip.vo.js +1 -1
  75. package/dist/pagination-take.vo.d.ts +1 -1
  76. package/dist/pagination-take.vo.js +1 -1
  77. package/dist/quarter-iso-id.vo.d.ts +1 -1
  78. package/dist/quarter-iso-id.vo.js +1 -1
  79. package/dist/reordering-item-position-value.vo.d.ts +1 -1
  80. package/dist/reordering-item-position-value.vo.js +1 -1
  81. package/dist/reordering.service.d.ts +1 -1
  82. package/dist/reordering.service.js +1 -1
  83. package/dist/revision-value.vo.d.ts +1 -1
  84. package/dist/revision-value.vo.js +1 -1
  85. package/dist/rounding-decimal.strategy.d.ts +1 -1
  86. package/dist/rounding-decimal.strategy.js +1 -1
  87. package/dist/size-bytes.vo.d.ts +1 -1
  88. package/dist/size-bytes.vo.js +1 -1
  89. package/dist/time-zone-offset-value.vo.d.ts +1 -1
  90. package/dist/time-zone-offset-value.vo.js +1 -1
  91. package/dist/timestamp-value.vo.d.ts +1 -1
  92. package/dist/timestamp-value.vo.js +1 -1
  93. package/dist/timezone.vo.d.ts +1 -1
  94. package/dist/timezone.vo.js +1 -1
  95. package/dist/tsconfig.tsbuildinfo +1 -1
  96. package/dist/url-with-slash.vo.d.ts +1 -1
  97. package/dist/url-with-slash.vo.js +1 -1
  98. package/dist/url-without-slash.vo.d.ts +1 -1
  99. package/dist/url-without-slash.vo.js +1 -1
  100. package/dist/week-iso-id.vo.d.ts +1 -1
  101. package/dist/week-iso-id.vo.js +1 -1
  102. package/dist/weight-grams.vo.d.ts +1 -1
  103. package/dist/weight-grams.vo.js +1 -1
  104. package/dist/year-iso-id.vo.d.ts +1 -1
  105. package/dist/year-iso-id.vo.js +1 -1
  106. package/package.json +2 -4
  107. package/readme.md +1 -0
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export declare const AgeYearsError: {
3
3
  Type: string;
4
4
  Invalid: string;
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export const AgeYearsError = { Type: "age.years.type", Invalid: "age.years.invalid" };
3
3
  export const AgeYearsConstraints = { min: 1, max: 130 };
4
4
  // Stryker disable all
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export declare const ApiKeyError: {
3
3
  Type: string;
4
4
  Length: string;
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export const ApiKeyError = { Type: "api.key.type", Length: "api.key.length", BadChars: "api.key.bad.chars" };
3
3
  // 64 letters and digits allowed
4
4
  const API_KEY_CHARS = /^[a-zA-Z0-9]{64}$/;
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export declare const BasenameError: {
3
3
  Type: string;
4
4
  Empty: string;
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export const BasenameError = {
3
3
  Type: "basename.type",
4
4
  Empty: "basename.empty",
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export declare const DayIsoIdError: {
3
3
  Type: string;
4
4
  BadChars: string;
@@ -1,5 +1,5 @@
1
1
  import { isValid, parseISO } from "date-fns";
2
- import { z } from "zod/v4";
2
+ import * as z from "zod/v4";
3
3
  export const DayIsoIdError = {
4
4
  Type: "day.iso.id.type",
5
5
  BadChars: "day.iso.id.bad.chars",
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export declare const DirectoryPathAbsoluteError: {
3
3
  BadSegments: string;
4
4
  Empty: string;
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export const DirectoryPathAbsoluteError = {
3
3
  BadSegments: "directory.path.absolue.bad.segments",
4
4
  Empty: "directory.path.absolue.empty",
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export declare const DirectoryPathRelativeError: {
3
3
  BadSegments: string;
4
4
  Empty: string;
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export const DirectoryPathRelativeError = {
3
3
  BadSegments: "directory.path.relative.bad.segments",
4
4
  Empty: "directory.path.relative.empty",
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export declare const DistanceValueError: {
3
3
  Type: string;
4
4
  Invalid: string;
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export const DistanceValueError = { Type: "distance.value.type", Invalid: "distance.value.invalid" };
3
3
  // Stryker disable all
4
4
  export const DistanceValue = z
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export declare const DivisionFactorError: {
3
3
  Type: string;
4
4
  Invalid: string;
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export const DivisionFactorError = { Type: "division.factor.type", Invalid: "division.factor.invalid" };
3
3
  // Stryker disable all
4
4
  export const DivisionFactor = z
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export declare const DurationMsError: {
3
3
  Invalid: string;
4
4
  };
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export const DurationMsError = { Invalid: "duration.invalid" };
3
3
  // Stryker disable all
4
4
  export const DurationMs = z.number(DurationMsError.Invalid).int(DurationMsError.Invalid).brand("DurationMs");
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export declare const EmailError: {
3
3
  Invalid: string;
4
4
  };
package/dist/email.vo.js CHANGED
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export const EmailError = { Invalid: "email.invalid" };
3
3
  // Stryker disable all
4
4
  export const Email = z.email(EmailError.Invalid).brand("Email");
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export declare const ExtensionError: {
3
3
  Type: string;
4
4
  Empty: string;
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export const ExtensionError = {
3
3
  Type: "extension.type",
4
4
  Empty: "extension.empty",
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export declare const FeatureFlagValueError: {
3
3
  Invalid: string;
4
4
  };
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export const FeatureFlagValueError = { Invalid: "feature.flag.value.invalid" };
3
3
  export var FeatureFlagEnum;
4
4
  (function (FeatureFlagEnum) {
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  import { Filename } from "./filename.vo";
3
3
  export declare const FilePathAbsoluteSchemaError: {
4
4
  Type: string;
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  import { DirectoryPathAbsoluteSchema } from "./directory-path-absolute.vo";
3
3
  import { Filename } from "./filename.vo";
4
4
  export const FilePathAbsoluteSchemaError = {
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  import { Filename } from "./filename.vo";
3
3
  export declare const FilePathRelativeSchemaError: {
4
4
  Type: string;
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  import { DirectoryPathRelativeSchema } from "./directory-path-relative.vo";
3
3
  import { Filename } from "./filename.vo";
4
4
  export const FilePathRelativeSchemaError = {
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export declare enum FilenameAffixStrategy {
3
3
  prefix = "prefix",
4
4
  suffix = "suffix"
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export var FilenameAffixStrategy;
3
3
  (function (FilenameAffixStrategy) {
4
4
  FilenameAffixStrategy["prefix"] = "prefix";
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export declare const FilenameFromStringError: {
3
3
  Type: string;
4
4
  Invalid: string;
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  import { Basename } from "./basename.vo";
3
3
  import { Extension } from "./extension.vo";
4
4
  export const FilenameFromStringError = {
@@ -1,7 +1,6 @@
1
1
  import { type BasenameType } from "./basename.vo";
2
2
  import { type ExtensionType } from "./extension.vo";
3
3
  import { FilenameAffixStrategy, type FilenameAffixType } from "./filename-affix.vo";
4
- import { Mime } from "./mime.vo";
5
4
  export declare class Filename {
6
5
  private readonly basename;
7
6
  private readonly extension;
@@ -12,7 +11,6 @@ export declare class Filename {
12
11
  get(): string;
13
12
  getBasename(): BasenameType;
14
13
  getExtension(): ExtensionType;
15
- getMime(): Mime;
16
14
  withExtension(extension: ExtensionType): Filename;
17
15
  withBasename(basename: BasenameType): Filename;
18
16
  withAffix(candidate: string, strategy: FilenameAffixStrategy): Filename;
@@ -2,7 +2,6 @@ import { Basename } from "./basename.vo";
2
2
  import { Extension } from "./extension.vo";
3
3
  import { FilenameAffix, FilenameAffixStrategy } from "./filename-affix.vo";
4
4
  import { FilenameFromString } from "./filename-from-string.vo";
5
- import { Mime } from "./mime.vo";
6
5
  export class Filename {
7
6
  basename;
8
7
  extension;
@@ -29,9 +28,6 @@ export class Filename {
29
28
  getExtension() {
30
29
  return this.extension;
31
30
  }
32
- getMime() {
33
- return Mime.fromExtension(this.extension);
34
- }
35
31
  withExtension(extension) {
36
32
  return new Filename(this.basename, extension);
37
33
  }
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export declare const HeightMillimetersError: {
3
3
  Type: string;
4
4
  Invalid: string;
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export const HeightMillimetersError = {
3
3
  Type: "height.millimeters.type",
4
4
  Invalid: "height.millimeters.invalid",
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export declare const HourSchemaError: {
3
3
  Type: string;
4
4
  Invalid: string;
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export const HourSchemaError = { Type: "hour.schema.type", Invalid: "hour.schema.invalid" };
3
3
  // Stryker disable all
4
4
  export const HourSchema = z
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export declare const IbanSchemaError: {
3
3
  Type: string;
4
4
  Invalid: string;
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
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}$/;
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export declare const ImageWidthError: {
3
3
  Type: string;
4
4
  Length: string;
package/dist/image.vo.js CHANGED
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
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 };
package/dist/index.d.ts CHANGED
@@ -46,6 +46,7 @@ export * from "./language.vo";
46
46
  export * from "./linear-regression.service";
47
47
  export * from "./mean.service";
48
48
  export * from "./mime.vo";
49
+ export * from "./mime-registry.service";
49
50
  export * from "./mime-types.vo";
50
51
  export * from "./mime-value.vo";
51
52
  export * from "./min-max-scaler.service";
package/dist/index.js CHANGED
@@ -46,6 +46,7 @@ export * from "./language.vo";
46
46
  export * from "./linear-regression.service";
47
47
  export * from "./mean.service";
48
48
  export * from "./mime.vo";
49
+ export * from "./mime-registry.service";
49
50
  export * from "./mime-types.vo";
50
51
  export * from "./mime-value.vo";
51
52
  export * from "./min-max-scaler.service";
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export declare const IntegerNonNegativeError: {
3
3
  Type: string;
4
4
  Invalid: string;
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export const IntegerNonNegativeError = {
3
3
  Type: "integer.non.negative.type",
4
4
  Invalid: "integer.non.negative.invalid",
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export declare const IntegerPositiveError: {
3
3
  Type: string;
4
4
  Invalid: string;
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export const IntegerPositiveError = { Type: "integer.positive.type", Invalid: "integer.positive.invalid" };
3
3
  // Stryker disable all
4
4
  export const IntegerPositive = z
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export declare const IntegerError: {
3
3
  Type: string;
4
4
  };
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export const IntegerError = { Type: "integer.type" };
3
3
  // Stryker disable all
4
4
  export const Integer = z.number(IntegerError.Type).int(IntegerError.Type).brand("Integer");
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export declare const LanguageError: {
3
3
  Type: string;
4
4
  BadChars: string;
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
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}$/;
@@ -0,0 +1,13 @@
1
+ import type { ExtensionType } from "./extension.vo";
2
+ import type { Mime } from "./mime.vo";
3
+ export type MimeRegistryEntry = {
4
+ mime: Mime;
5
+ extensions: ExtensionType[];
6
+ };
7
+ export declare class MimeRegistry {
8
+ private readonly byExtension;
9
+ private readonly byMime;
10
+ constructor(entries: readonly MimeRegistryEntry[]);
11
+ fromExtension(extension: ExtensionType): Mime | undefined;
12
+ toExtension(mime: Mime): ExtensionType | undefined;
13
+ }
@@ -0,0 +1,19 @@
1
+ export class MimeRegistry {
2
+ byExtension = new Map();
3
+ byMime = new Map();
4
+ constructor(entries) {
5
+ for (const entry of entries) {
6
+ for (const extension of entry.extensions) {
7
+ this.byExtension.set(extension, entry.mime);
8
+ }
9
+ const canonical = entry.extensions[0];
10
+ this.byMime.set(entry.mime.toString(), canonical);
11
+ }
12
+ }
13
+ fromExtension(extension) {
14
+ return this.byExtension.get(extension);
15
+ }
16
+ toExtension(mime) {
17
+ return this.byMime.get(mime.toString());
18
+ }
19
+ }
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export declare const MimeValueError: {
3
3
  Type: string;
4
4
  Invalid: string;
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
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 twenty four lowercase letters, asterisk or hyphen
4
4
  const MIME_VALUE_CHARS_WHITELIST = /^[a-z*-]{1,24}\/[a-z*-]{1,24}$/;
package/dist/mime.vo.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- import { type ExtensionType } from "./extension.vo";
2
1
  export declare const MimeError: {
3
2
  NotAccepted: string;
4
3
  };
@@ -7,9 +6,7 @@ export declare class Mime {
7
6
  readonly subtype: string;
8
7
  private constructor();
9
8
  static fromString(candidate: string): Mime;
10
- static fromExtension(extension: ExtensionType): Mime;
11
9
  isSatisfiedBy(another: Mime): boolean;
12
- toExtension(): ExtensionType;
13
10
  toString(): string;
14
11
  toJSON(): {
15
12
  type: string;
package/dist/mime.vo.js CHANGED
@@ -1,5 +1,3 @@
1
- import * as mime from "mime-types";
2
- import { Extension } from "./extension.vo";
3
1
  import { MimeValue } from "./mime-value.vo";
4
2
  export const MimeError = { NotAccepted: "mime.not.accepted" };
5
3
  export class Mime {
@@ -13,17 +11,11 @@ export class Mime {
13
11
  const { type, subtype } = MimeValue.parse(candidate.split(";")[0].trim());
14
12
  return new Mime(type, subtype);
15
13
  }
16
- static fromExtension(extension) {
17
- return Mime.fromString(String(mime.contentType(extension)));
18
- }
19
14
  isSatisfiedBy(another) {
20
15
  if (!(this.type === another.type || this.type === "*"))
21
16
  return false;
22
17
  return this.subtype === another.subtype || this.subtype === "*";
23
18
  }
24
- toExtension() {
25
- return Extension.parse(mime.extension(this.toString()));
26
- }
27
19
  toString() {
28
20
  return `${this.type}/${this.subtype}`;
29
21
  }
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export declare const MinuteSchemaError: {
3
3
  Type: string;
4
4
  Invalid: string;
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export const MinuteSchemaError = { Type: "minute.schema.error", Invalid: "minute.schema.invalid" };
3
3
  // Stryker disable all
4
4
  export const MinuteSchema = z
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export declare const MoneyAmountError: {
3
3
  Type: string;
4
4
  Invalid: string;
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export const MoneyAmountError = { Type: "money.amount.type", Invalid: "money.amount.invalid" };
3
3
  // Stryker disable all
4
4
  export const MoneyAmount = z
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export declare const MonthIsoIdError: {
3
3
  Type: string;
4
4
  BadChars: string;
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export const MonthIsoIdError = {
3
3
  Type: "month.iso.id.type",
4
4
  BadChars: "month.iso.id.bad.chars",
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export declare const MultiplicationFactorError: {
3
3
  Type: string;
4
4
  Invalid: string;
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export const MultiplicationFactorError = {
3
3
  Type: "multiplication.factor.type",
4
4
  Invalid: "multiplication.factor.invalid",
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export declare const ObjectKeyError: {
3
3
  Type: string;
4
4
  LeadingSlash: string;
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export const ObjectKeyError = {
3
3
  Type: "object.key.type",
4
4
  LeadingSlash: "object.key.leading.slash",
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export declare const PackageVersionSchemaError: {
3
3
  Type: string;
4
4
  BadChars: string;
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export const PackageVersionSchemaError = {
3
3
  Type: "package.version.schema.error",
4
4
  BadChars: "package.version.schema.bad.chars",
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export declare const PaginationPageError: {
3
3
  Type: string;
4
4
  };
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export const PaginationPageError = { Type: "pagination.page.type" };
3
3
  export const Page = z.coerce
4
4
  .number(PaginationPageError.Type)
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export declare const PaginationSkipError: {
3
3
  Type: string;
4
4
  Invalid: string;
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export const PaginationSkipError = { Type: "pagination.skip.type", Invalid: "pagination.skip.invalid" };
3
3
  export const Skip = z
4
4
  .number(PaginationSkipError.Type)
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export declare const PaginationTakeError: {
3
3
  Type: string;
4
4
  Invalid: string;
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export const PaginationTakeError = { Type: "pagination.take.type", Invalid: "pagination.take.invalid" };
3
3
  export const Take = z
4
4
  .number(PaginationTakeError.Type)
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export declare const QuarterIsoIdError: {
3
3
  Type: string;
4
4
  BadChars: string;
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export const QuarterIsoIdError = {
3
3
  Type: "quarter.iso.id.type",
4
4
  BadChars: "quarter.iso.id.bad.chars",
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export declare const ReorderingItemPositionValueError: {
3
3
  Invalid: string;
4
4
  };
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export const ReorderingItemPositionValueError = { Invalid: "reordering.position.type" };
3
3
  export const ReorderingItemPositionValue = z
4
4
  .number(ReorderingItemPositionValueError.Invalid)
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  import { type ReorderingItemPositionValueType } from "./reordering-item-position-value.vo";
3
3
  export declare const ReorderingError: {
4
4
  CannotFindItem: string;
@@ -1,5 +1,5 @@
1
1
  // Stryker disable all
2
- import { z } from "zod/v4";
2
+ import * as z from "zod/v4";
3
3
  import { DoublyLinkedList, Node } from "./dll.service";
4
4
  import { ReorderingItemPositionValue, } from "./reordering-item-position-value.vo";
5
5
  export const ReorderingError = {
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export declare const RevisionValueError: {
3
3
  Type: string;
4
4
  Invalid: string;
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export const RevisionValueError = { Type: "revision.value.type", Invalid: "revision.value.invalid" };
3
3
  export const RevisionValue = z
4
4
  .number(RevisionValueError.Type)
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  import type { RoundingStrategy } from "./rounding.strategy";
3
3
  export declare const RoundingDecimalError: {
4
4
  Type: string;
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export const RoundingDecimalError = { Type: "rounding.decimal.type", Invalid: "rounding.decimal.invalid" };
3
3
  // Stryker disable all
4
4
  export const RoundingDecimal = z
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export declare const SizeBytesError: {
3
3
  Invalid: string;
4
4
  };
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export const SizeBytesError = { Invalid: "size.bytes.invalid" };
3
3
  // Stryker disable all
4
4
  export const SizeBytes = z
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export declare const TimeZoneOffsetValueError: {
3
3
  Type: string;
4
4
  Min: string;
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export const TimeZoneOffsetValueError = {
3
3
  Type: "time.zone.offset.value.type",
4
4
  Min: "time.zone.offset.value.min",
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export declare const TimestampValueError: {
3
3
  Invalid: string;
4
4
  };
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export const TimestampValueError = { Invalid: "timestamp.invalid" };
3
3
  // Stryker disable all
4
4
  export const TimestampValue = z
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export declare const TimezoneError: {
3
3
  Type: string;
4
4
  Empty: string;
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export const TimezoneError = {
3
3
  Type: "timezone.type",
4
4
  Empty: "timezone.empty",
@@ -1 +1 @@
1
- {"root":["../src/age-years.vo.ts","../src/age.vo.ts","../src/api-key.vo.ts","../src/basename.vo.ts","../src/clock-format.service.ts","../src/clock.vo.ts","../src/date-calculator.service.ts","../src/date-formatter.service.ts","../src/date-range.vo.ts","../src/day-iso-id.vo.ts","../src/day.vo.ts","../src/directory-path-absolute.vo.ts","../src/directory-path-relative.vo.ts","../src/distance-value.vo.ts","../src/distance.vo.ts","../src/division-factor.vo.ts","../src/dll.service.ts","../src/duration-ms.vo.ts","../src/duration.service.ts","../src/email-mask.service.ts","../src/email.vo.ts","../src/etags.vo.ts","../src/extension.vo.ts","../src/feature-flag-value.vo.ts","../src/feature-flag.vo.ts","../src/file-path-absolute-schema.vo.ts","../src/file-path-relative-schema.vo.ts","../src/file-path.vo.ts","../src/filename-affix.vo.ts","../src/filename-from-string.vo.ts","../src/filename.vo.ts","../src/height-milimiters.vo.ts","../src/height.vo.ts","../src/hour-format.service.ts","../src/hour-schema.vo.ts","../src/hour.vo.ts","../src/iban-mask.service.ts","../src/iban-schema.vo.ts","../src/iban.vo.ts","../src/image.vo.ts","../src/index.ts","../src/integer-non-negative.vo.ts","../src/integer-positive.vo.ts","../src/integer.vo.ts","../src/language.vo.ts","../src/linear-regression.service.ts","../src/mean.service.ts","../src/mime-types.vo.ts","../src/mime-value.vo.ts","../src/mime.vo.ts","../src/min-max-scaler.service.ts","../src/minute-schema.vo.ts","../src/minute.vo.ts","../src/money-amount.vo.ts","../src/money.vo.ts","../src/month-iso-id.vo.ts","../src/month.vo.ts","../src/multiplication-factor.vo.ts","../src/noop.service.ts","../src/notification-template.vo.ts","../src/object-key.vo.ts","../src/outlier-detector.service.ts","../src/package-version-schema.vo.ts","../src/package-version.vo.ts","../src/pagination-page.vo.ts","../src/pagination-skip.vo.ts","../src/pagination-take.vo.ts","../src/pagination.service.ts","../src/percentage.service.ts","../src/population-standard-deviation.service.ts","../src/quarter-iso-id.vo.ts","../src/quarter.vo.ts","../src/random.service.ts","../src/rate-limiter.service.ts","../src/relative-date.vo.ts","../src/reordering-item-position-value.vo.ts","../src/reordering.service.ts","../src/revision-value.vo.ts","../src/revision.vo.ts","../src/rounding-decimal.strategy.ts","../src/rounding-down.strategy.ts","../src/rounding-to-nearest.strategy.ts","../src/rounding-up.strategy.ts","../src/rounding.strategy.ts","../src/size-bytes.vo.ts","../src/size.vo.ts","../src/slug.service.ts","../src/sum.service.ts","../src/thousands-separator.service.ts","../src/time-zone-offset-value.vo.ts","../src/timestamp-value.vo.ts","../src/timestamp.vo.ts","../src/timezone.vo.ts","../src/ts-utils.ts","../src/url-with-slash.vo.ts","../src/url-without-slash.vo.ts","../src/visually-unambiguous-characters-generator.service.ts","../src/week-iso-id.vo.ts","../src/week.vo.ts","../src/weekday.vo.ts","../src/weight-grams.vo.ts","../src/weight.vo.ts","../src/year-iso-id.vo.ts","../src/year.vo.ts","../src/z-score.service.ts"],"version":"5.9.3"}
1
+ {"root":["../src/age-years.vo.ts","../src/age.vo.ts","../src/api-key.vo.ts","../src/basename.vo.ts","../src/clock-format.service.ts","../src/clock.vo.ts","../src/date-calculator.service.ts","../src/date-formatter.service.ts","../src/date-range.vo.ts","../src/day-iso-id.vo.ts","../src/day.vo.ts","../src/directory-path-absolute.vo.ts","../src/directory-path-relative.vo.ts","../src/distance-value.vo.ts","../src/distance.vo.ts","../src/division-factor.vo.ts","../src/dll.service.ts","../src/duration-ms.vo.ts","../src/duration.service.ts","../src/email-mask.service.ts","../src/email.vo.ts","../src/etags.vo.ts","../src/extension.vo.ts","../src/feature-flag-value.vo.ts","../src/feature-flag.vo.ts","../src/file-path-absolute-schema.vo.ts","../src/file-path-relative-schema.vo.ts","../src/file-path.vo.ts","../src/filename-affix.vo.ts","../src/filename-from-string.vo.ts","../src/filename.vo.ts","../src/height-milimiters.vo.ts","../src/height.vo.ts","../src/hour-format.service.ts","../src/hour-schema.vo.ts","../src/hour.vo.ts","../src/iban-mask.service.ts","../src/iban-schema.vo.ts","../src/iban.vo.ts","../src/image.vo.ts","../src/index.ts","../src/integer-non-negative.vo.ts","../src/integer-positive.vo.ts","../src/integer.vo.ts","../src/language.vo.ts","../src/linear-regression.service.ts","../src/mean.service.ts","../src/mime-registry.service.ts","../src/mime-types.vo.ts","../src/mime-value.vo.ts","../src/mime.vo.ts","../src/min-max-scaler.service.ts","../src/minute-schema.vo.ts","../src/minute.vo.ts","../src/money-amount.vo.ts","../src/money.vo.ts","../src/month-iso-id.vo.ts","../src/month.vo.ts","../src/multiplication-factor.vo.ts","../src/noop.service.ts","../src/notification-template.vo.ts","../src/object-key.vo.ts","../src/outlier-detector.service.ts","../src/package-version-schema.vo.ts","../src/package-version.vo.ts","../src/pagination-page.vo.ts","../src/pagination-skip.vo.ts","../src/pagination-take.vo.ts","../src/pagination.service.ts","../src/percentage.service.ts","../src/population-standard-deviation.service.ts","../src/quarter-iso-id.vo.ts","../src/quarter.vo.ts","../src/random.service.ts","../src/rate-limiter.service.ts","../src/relative-date.vo.ts","../src/reordering-item-position-value.vo.ts","../src/reordering.service.ts","../src/revision-value.vo.ts","../src/revision.vo.ts","../src/rounding-decimal.strategy.ts","../src/rounding-down.strategy.ts","../src/rounding-to-nearest.strategy.ts","../src/rounding-up.strategy.ts","../src/rounding.strategy.ts","../src/size-bytes.vo.ts","../src/size.vo.ts","../src/slug.service.ts","../src/sum.service.ts","../src/thousands-separator.service.ts","../src/time-zone-offset-value.vo.ts","../src/timestamp-value.vo.ts","../src/timestamp.vo.ts","../src/timezone.vo.ts","../src/ts-utils.ts","../src/url-with-slash.vo.ts","../src/url-without-slash.vo.ts","../src/visually-unambiguous-characters-generator.service.ts","../src/week-iso-id.vo.ts","../src/week.vo.ts","../src/weekday.vo.ts","../src/weight-grams.vo.ts","../src/weight.vo.ts","../src/year-iso-id.vo.ts","../src/year.vo.ts","../src/z-score.service.ts"],"version":"5.9.3"}
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export declare const UrlWithSlashError: {
3
3
  Invalid: string;
4
4
  };
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export const UrlWithSlashError = { Invalid: "url.with.slash.invalid" };
3
3
  // Stryker disable all
4
4
  export const UrlWithSlash = z
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export declare const UrlWithoutSlashError: {
3
3
  Invalid: string;
4
4
  };
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export const UrlWithoutSlashError = { Invalid: "url.without.slash.invalid" };
3
3
  // Stryker disable all
4
4
  export const UrlWithoutSlash = z
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export declare const WeekIsoIdError: {
3
3
  Type: string;
4
4
  BadChars: string;
@@ -1,5 +1,5 @@
1
1
  import { getISOWeeksInYear } from "date-fns";
2
- import { z } from "zod/v4";
2
+ import * as z from "zod/v4";
3
3
  export const WeekIsoIdError = {
4
4
  Type: "week.iso.id.type",
5
5
  BadChars: "week.iso.id.bad.chars",
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export declare const WeightGramsError: {
3
3
  Type: string;
4
4
  Invalid: string;
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export const WeightGramsError = { Type: "weight.grams.type", Invalid: "weight.grams.invalid" };
3
3
  // Stryker disable all
4
4
  export const WeightGrams = z
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export declare const YearIsoIdError: {
3
3
  Type: string;
4
4
  BadChars: string;
@@ -1,4 +1,4 @@
1
- import { z } from "zod/v4";
1
+ import * as z from "zod/v4";
2
2
  export const YearIsoIdError = { Type: "year.iso.id.type", BadChars: "year.iso.id.bad.chars" };
3
3
  // Four digits
4
4
  const YEAR_ISO_ID_CHARS_WHITELIST = /^[0-9]{4}$/;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bgord/tools",
3
- "version": "1.2.21",
3
+ "version": "1.3.0",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "author": "Bartosz Gordon",
@@ -25,7 +25,6 @@
25
25
  "@commitlint/config-conventional": "20.3.1",
26
26
  "@stryker-mutator/core": "9.4.0",
27
27
  "@types/bun": "1.3.6",
28
- "@types/mime-types": "3.0.1",
29
28
  "cspell": "9.6.0",
30
29
  "knip": "5.81.0",
31
30
  "lefthook": "2.0.15",
@@ -36,8 +35,7 @@
36
35
  "zod": "4.3.5"
37
36
  },
38
37
  "dependencies": {
39
- "date-fns": "4.1.0",
40
- "mime-types": "3.0.2"
38
+ "date-fns": "4.1.0"
41
39
  },
42
40
  "peerDependencies": {
43
41
  "zod": "4.3.5"
package/readme.md CHANGED
@@ -70,6 +70,7 @@ src/
70
70
  ├── language.vo.ts
71
71
  ├── linear-regression.service.ts
72
72
  ├── mean.service.ts
73
+ ├── mime-registry.service.ts
73
74
  ├── mime-types.vo.ts
74
75
  ├── mime-value.vo.ts
75
76
  ├── mime.vo.ts