@palmares/schemas 0.1.17 → 0.1.19

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 (178) hide show
  1. package/.turbo/turbo-build.log +7 -7
  2. package/CHANGELOG.md +20 -0
  3. package/dist/cjs/src/adapter/fields/array.js +5 -10
  4. package/dist/cjs/src/adapter/fields/boolean.js +5 -10
  5. package/dist/cjs/src/adapter/fields/datetime.js +5 -10
  6. package/dist/cjs/src/adapter/fields/index.js +1 -1
  7. package/dist/cjs/src/adapter/fields/number.js +3 -8
  8. package/dist/cjs/src/adapter/fields/object.js +3 -8
  9. package/dist/cjs/src/adapter/fields/string.js +3 -8
  10. package/dist/cjs/src/adapter/fields/union.js +3 -8
  11. package/dist/cjs/src/adapter/index.js +1 -1
  12. package/dist/cjs/src/compile.js +1 -1
  13. package/dist/cjs/src/domain.js +2 -3
  14. package/dist/cjs/src/index.js +49 -92
  15. package/dist/cjs/src/middleware.js +1 -3
  16. package/dist/cjs/src/model.js +10 -15
  17. package/dist/cjs/src/parsers/convert-from-number.js +1 -6
  18. package/dist/cjs/src/parsers/convert-from-string.js +1 -6
  19. package/dist/cjs/src/parsers/index.js +4 -9
  20. package/dist/cjs/src/schema/array.js +7 -12
  21. package/dist/cjs/src/schema/boolean.js +7 -12
  22. package/dist/cjs/src/schema/datetime.js +5 -10
  23. package/dist/cjs/src/schema/index.js +2 -7
  24. package/dist/cjs/src/schema/number.js +3 -8
  25. package/dist/cjs/src/schema/object.js +6 -11
  26. package/dist/cjs/src/schema/schema.js +1 -1
  27. package/dist/cjs/src/schema/string.js +3 -8
  28. package/dist/cjs/src/schema/union.js +5 -10
  29. package/dist/cjs/src/utils.js +10 -15
  30. package/dist/cjs/src/validators/utils.js +1 -1
  31. package/dist/cjs/tsconfig.types.tsbuildinfo +1 -1
  32. package/dist/cjs/types/adapter/fields/array.d.ts +3 -3
  33. package/dist/cjs/types/adapter/fields/array.d.ts.map +1 -1
  34. package/dist/cjs/types/adapter/fields/boolean.d.ts +4 -4
  35. package/dist/cjs/types/adapter/fields/boolean.d.ts.map +1 -1
  36. package/dist/cjs/types/adapter/fields/datetime.d.ts +4 -4
  37. package/dist/cjs/types/adapter/fields/datetime.d.ts.map +1 -1
  38. package/dist/cjs/types/adapter/fields/index.d.ts +3 -3
  39. package/dist/cjs/types/adapter/fields/index.d.ts.map +1 -1
  40. package/dist/cjs/types/adapter/fields/number.d.ts +4 -4
  41. package/dist/cjs/types/adapter/fields/number.d.ts.map +1 -1
  42. package/dist/cjs/types/adapter/fields/object.d.ts +4 -4
  43. package/dist/cjs/types/adapter/fields/object.d.ts.map +1 -1
  44. package/dist/cjs/types/adapter/fields/string.d.ts +4 -4
  45. package/dist/cjs/types/adapter/fields/string.d.ts.map +1 -1
  46. package/dist/cjs/types/adapter/fields/union.d.ts +4 -4
  47. package/dist/cjs/types/adapter/fields/union.d.ts.map +1 -1
  48. package/dist/cjs/types/adapter/index.d.ts +9 -9
  49. package/dist/cjs/types/adapter/index.d.ts.map +1 -1
  50. package/dist/cjs/types/adapter/types.d.ts +1 -1
  51. package/dist/cjs/types/adapter/types.d.ts.map +1 -1
  52. package/dist/cjs/types/compile.d.ts +2 -2
  53. package/dist/cjs/types/compile.d.ts.map +1 -1
  54. package/dist/cjs/types/conf.d.ts +1 -1
  55. package/dist/cjs/types/conf.d.ts.map +1 -1
  56. package/dist/cjs/types/domain.d.ts +1 -2
  57. package/dist/cjs/types/domain.d.ts.map +1 -1
  58. package/dist/cjs/types/index.d.ts +21 -20
  59. package/dist/cjs/types/index.d.ts.map +1 -1
  60. package/dist/cjs/types/middleware.d.ts +2 -2
  61. package/dist/cjs/types/middleware.d.ts.map +1 -1
  62. package/dist/cjs/types/model.d.ts +3 -3
  63. package/dist/cjs/types/model.d.ts.map +1 -1
  64. package/dist/cjs/types/parsers/convert-from-number.d.ts +2 -2
  65. package/dist/cjs/types/parsers/convert-from-number.d.ts.map +1 -1
  66. package/dist/cjs/types/parsers/convert-from-string.d.ts +2 -2
  67. package/dist/cjs/types/parsers/convert-from-string.d.ts.map +1 -1
  68. package/dist/cjs/types/parsers/index.d.ts +2 -2
  69. package/dist/cjs/types/parsers/index.d.ts.map +1 -1
  70. package/dist/cjs/types/schema/array.d.ts +2 -2
  71. package/dist/cjs/types/schema/array.d.ts.map +1 -1
  72. package/dist/cjs/types/schema/boolean.d.ts +2 -2
  73. package/dist/cjs/types/schema/boolean.d.ts.map +1 -1
  74. package/dist/cjs/types/schema/datetime.d.ts +2 -2
  75. package/dist/cjs/types/schema/datetime.d.ts.map +1 -1
  76. package/dist/cjs/types/schema/index.d.ts +1 -1
  77. package/dist/cjs/types/schema/index.d.ts.map +1 -1
  78. package/dist/cjs/types/schema/number.d.ts +2 -2
  79. package/dist/cjs/types/schema/number.d.ts.map +1 -1
  80. package/dist/cjs/types/schema/object.d.ts +3 -3
  81. package/dist/cjs/types/schema/object.d.ts.map +1 -1
  82. package/dist/cjs/types/schema/schema.d.ts +4 -4
  83. package/dist/cjs/types/schema/schema.d.ts.map +1 -1
  84. package/dist/cjs/types/schema/string.d.ts +2 -2
  85. package/dist/cjs/types/schema/string.d.ts.map +1 -1
  86. package/dist/cjs/types/schema/types.d.ts +7 -7
  87. package/dist/cjs/types/schema/types.d.ts.map +1 -1
  88. package/dist/cjs/types/schema/union.d.ts +3 -3
  89. package/dist/cjs/types/schema/union.d.ts.map +1 -1
  90. package/dist/cjs/types/types.d.ts +2 -2
  91. package/dist/cjs/types/types.d.ts.map +1 -1
  92. package/dist/cjs/types/utils.d.ts +4 -4
  93. package/dist/cjs/types/utils.d.ts.map +1 -1
  94. package/dist/cjs/types/validators/array.d.ts +2 -2
  95. package/dist/cjs/types/validators/array.d.ts.map +1 -1
  96. package/dist/cjs/types/validators/datetime.d.ts +1 -1
  97. package/dist/cjs/types/validators/datetime.d.ts.map +1 -1
  98. package/dist/cjs/types/validators/number.d.ts +1 -1
  99. package/dist/cjs/types/validators/number.d.ts.map +1 -1
  100. package/dist/cjs/types/validators/object.d.ts +1 -1
  101. package/dist/cjs/types/validators/object.d.ts.map +1 -1
  102. package/dist/cjs/types/validators/schema.d.ts +4 -4
  103. package/dist/cjs/types/validators/schema.d.ts.map +1 -1
  104. package/dist/cjs/types/validators/string.d.ts +1 -1
  105. package/dist/cjs/types/validators/string.d.ts.map +1 -1
  106. package/dist/cjs/types/validators/union.d.ts +1 -1
  107. package/dist/cjs/types/validators/union.d.ts.map +1 -1
  108. package/dist/cjs/types/validators/utils.d.ts +2 -2
  109. package/dist/cjs/types/validators/utils.d.ts.map +1 -1
  110. package/dist/esm/src/adapter/fields/array.js +2 -2
  111. package/dist/esm/src/adapter/fields/boolean.js +2 -2
  112. package/dist/esm/src/adapter/fields/datetime.js +2 -2
  113. package/dist/esm/src/adapter/fields/index.js +1 -1
  114. package/dist/esm/src/adapter/fields/number.js +2 -2
  115. package/dist/esm/src/adapter/fields/object.js +2 -2
  116. package/dist/esm/src/adapter/fields/string.js +2 -2
  117. package/dist/esm/src/adapter/fields/union.js +2 -2
  118. package/dist/esm/src/adapter/index.js +1 -1
  119. package/dist/esm/src/compile.js +1 -1
  120. package/dist/esm/src/domain.js +1 -2
  121. package/dist/esm/src/index.js +21 -20
  122. package/dist/esm/src/middleware.js +1 -1
  123. package/dist/esm/src/model.js +3 -3
  124. package/dist/esm/src/parsers/convert-from-number.js +1 -1
  125. package/dist/esm/src/parsers/convert-from-string.js +1 -1
  126. package/dist/esm/src/parsers/index.js +2 -2
  127. package/dist/esm/src/schema/array.js +3 -3
  128. package/dist/esm/src/schema/boolean.js +3 -3
  129. package/dist/esm/src/schema/datetime.js +2 -2
  130. package/dist/esm/src/schema/index.js +1 -1
  131. package/dist/esm/src/schema/number.js +2 -2
  132. package/dist/esm/src/schema/object.js +3 -3
  133. package/dist/esm/src/schema/schema.js +1 -1
  134. package/dist/esm/src/schema/string.js +2 -2
  135. package/dist/esm/src/schema/union.js +3 -3
  136. package/dist/esm/src/utils.js +3 -3
  137. package/dist/esm/src/validators/utils.js +1 -1
  138. package/package.json +4 -4
  139. package/src/adapter/fields/array.ts +4 -4
  140. package/src/adapter/fields/boolean.ts +4 -4
  141. package/src/adapter/fields/datetime.ts +4 -4
  142. package/src/adapter/fields/index.ts +3 -3
  143. package/src/adapter/fields/number.ts +4 -4
  144. package/src/adapter/fields/object.ts +4 -4
  145. package/src/adapter/fields/string.ts +4 -4
  146. package/src/adapter/fields/union.ts +4 -4
  147. package/src/adapter/index.ts +9 -9
  148. package/src/adapter/types.ts +1 -1
  149. package/src/compile.ts +2 -2
  150. package/src/conf.ts +1 -1
  151. package/src/domain.ts +1 -3
  152. package/src/index.ts +21 -20
  153. package/src/middleware.ts +2 -2
  154. package/src/model.ts +3 -3
  155. package/src/parsers/convert-from-number.ts +2 -2
  156. package/src/parsers/convert-from-string.ts +3 -3
  157. package/src/parsers/index.ts +2 -2
  158. package/src/schema/array.ts +3 -3
  159. package/src/schema/boolean.ts +3 -3
  160. package/src/schema/datetime.ts +2 -2
  161. package/src/schema/index.ts +1 -1
  162. package/src/schema/number.ts +2 -2
  163. package/src/schema/object.ts +4 -4
  164. package/src/schema/schema.ts +4 -4
  165. package/src/schema/string.ts +2 -2
  166. package/src/schema/types.ts +7 -7
  167. package/src/schema/union.ts +4 -4
  168. package/src/types.ts +2 -2
  169. package/src/utils.ts +5 -5
  170. package/src/validators/array.ts +2 -2
  171. package/src/validators/boolean.ts +1 -1
  172. package/src/validators/datetime.ts +2 -2
  173. package/src/validators/number.ts +2 -2
  174. package/src/validators/object.ts +1 -1
  175. package/src/validators/schema.ts +4 -4
  176. package/src/validators/string.ts +2 -2
  177. package/src/validators/union.ts +1 -1
  178. package/src/validators/utils.ts +2 -2
@@ -1,4 +1,4 @@
1
- import type Schema from '../schema/schema';
1
+ import type { Schema } from '../schema/schema';
2
2
 
3
3
  /**
4
4
  * This will convert a value from a string to any other type.
@@ -6,14 +6,14 @@ import type Schema from '../schema/schema';
6
6
  * @param callback
7
7
  * @returns
8
8
  */
9
- export default function convertFromStringBuilder(
9
+ export function convertFromStringBuilder(
10
10
  callback: (value: string) => Awaited<ReturnType<Parameters<Schema['__parsers']['high']['set']>[1]>>
11
11
  ): Parameters<Schema['__parsers']['high']['set']>[1] {
12
12
  return (value: any) => {
13
13
  if (typeof value === 'string') return callback(value);
14
14
  return {
15
15
  value,
16
- preventNextParsers: false,
16
+ preventNextParsers: false
17
17
  };
18
18
  };
19
19
  }
@@ -1,2 +1,2 @@
1
- export { default as convertFromNumberBuilder } from './convert-from-number';
2
- export { default as convertFromStringBuilder } from './convert-from-string';
1
+ export { convertFromNumberBuilder } from './convert-from-number';
2
+ export { convertFromStringBuilder } from './convert-from-string';
@@ -1,4 +1,4 @@
1
- import Schema from './schema';
1
+ import { Schema } from './schema';
2
2
  import {
3
3
  defaultTransform,
4
4
  defaultTransformToAdapter,
@@ -7,11 +7,11 @@ import {
7
7
  } from '../utils';
8
8
  import { arrayValidation, maxLength, minLength, nonEmpty } from '../validators/array';
9
9
  import { nullable, optional } from '../validators/schema';
10
- import Validator from '../validators/utils';
10
+ import { Validator } from '../validators/utils';
11
11
 
12
12
  import type { DefinitionsOfSchemaType, ExtractTypeFromArrayOfSchemas } from './types';
13
13
 
14
- export default class ArraySchema<
14
+ export class ArraySchema<
15
15
  TType extends {
16
16
  input: any;
17
17
  validate: any;
@@ -1,12 +1,12 @@
1
- import Schema from './schema';
2
- import convertFromStringBuilder from '../parsers/convert-from-string';
1
+ import { Schema } from './schema';
2
+ import { convertFromStringBuilder } from '../parsers/convert-from-string';
3
3
  import { defaultTransform, defaultTransformToAdapter } from '../utils';
4
4
  import { booleanValidation } from '../validators/boolean';
5
5
  import { is, nullable, optional } from '../validators/schema';
6
6
 
7
7
  import type { DefinitionsOfSchemaType } from './types';
8
8
 
9
- export default class BooleanSchema<
9
+ export class BooleanSchema<
10
10
  TType extends {
11
11
  input: any;
12
12
  validate: any;
@@ -1,11 +1,11 @@
1
- import Schema from './schema';
1
+ import { Schema } from './schema';
2
2
  import { defaultTransform, defaultTransformToAdapter } from '../utils';
3
3
  import { above, allowStringParser, below, datetimeValidation } from '../validators/datetime';
4
4
  import { nullable, optional } from '../validators/schema';
5
5
 
6
6
  import type { DefinitionsOfSchemaType } from './types';
7
7
 
8
- export default class DatetimeSchema<
8
+ export class DatetimeSchema<
9
9
  TType extends {
10
10
  input: any;
11
11
  validate: any;
@@ -1,4 +1,4 @@
1
- import NumberSchema from './number';
1
+ import { NumberSchema } from './number';
2
2
 
3
3
  const number = NumberSchema.new; // teste
4
4
 
@@ -1,4 +1,4 @@
1
- import Schema from './schema';
1
+ import { Schema } from './schema';
2
2
  import {
3
3
  DEFAULT_NUMBER_INTEGER_EXCEPTION,
4
4
  DEFAULT_NUMBER_MAX_EXCEPTION,
@@ -11,7 +11,7 @@ import { is, nullable, optional } from '../validators/schema';
11
11
 
12
12
  import type { DefinitionsOfSchemaType } from './types';
13
13
 
14
- export default class NumberSchema<
14
+ export class NumberSchema<
15
15
  TType extends {
16
16
  input: any;
17
17
  validate: any;
@@ -1,4 +1,4 @@
1
- import Schema from './schema';
1
+ import { Schema } from './schema';
2
2
  import {
3
3
  defaultTransform,
4
4
  defaultTransformToAdapter,
@@ -6,12 +6,12 @@ import {
6
6
  transformSchemaAndCheckIfShouldBeHandledByFallbackOnComplexSchemas
7
7
  } from '../utils';
8
8
  import { objectValidation } from '../validators/object';
9
- import Validator from '../validators/utils';
9
+ import { Validator } from '../validators/utils';
10
10
 
11
11
  import type { DefinitionsOfSchemaType, ExtractTypeFromObjectOfSchemas } from './types';
12
- import type FieldAdapter from '../adapter/fields';
12
+ import type { FieldAdapter } from '../adapter/fields';
13
13
 
14
- export default class ObjectSchema<
14
+ export class ObjectSchema<
15
15
  TType extends {
16
16
  input: any;
17
17
  validate: any;
@@ -6,12 +6,12 @@ import type {
6
6
  OnlyFieldAdaptersFromSchemaAdapter,
7
7
  ValidationFallbackCallbackReturnType
8
8
  } from './types';
9
- import type SchemaAdapter from '../adapter';
10
- import type FieldAdapter from '../adapter/fields';
9
+ import type { SchemaAdapter } from '../adapter';
10
+ import type { FieldAdapter } from '../adapter/fields';
11
11
  import type { ValidationDataBasedOnType } from '../adapter/types';
12
- import type Validator from '../validators/utils';
12
+ import type { Validator } from '../validators/utils';
13
13
 
14
- export default class Schema<
14
+ export class Schema<
15
15
  TType extends {
16
16
  input: any;
17
17
  validate: any;
@@ -1,4 +1,4 @@
1
- import Schema from './schema';
1
+ import { Schema } from './schema';
2
2
  import { defaultTransform, defaultTransformToAdapter } from '../utils';
3
3
  import { is, nullable, optional } from '../validators/schema';
4
4
  import {
@@ -15,7 +15,7 @@ import {
15
15
 
16
16
  import type { DefinitionsOfSchemaType } from './types';
17
17
 
18
- export default class StringSchema<
18
+ export class StringSchema<
19
19
  TType extends {
20
20
  input: any;
21
21
  validate: any;
@@ -1,12 +1,12 @@
1
- import type BooleanSchema from './boolean';
2
- import type ObjectSchema from './object';
3
- import type Schema from './schema';
4
- import type StringSchema from './string';
5
- import type SchemaAdapter from '../adapter';
6
- import type FieldAdapter from '../adapter/fields';
1
+ import type { BooleanSchema } from './boolean';
2
+ import type { ObjectSchema } from './object';
3
+ import type { Schema } from './schema';
4
+ import type { StringSchema } from './string';
5
+ import type { SchemaAdapter } from '../adapter';
6
+ import type { FieldAdapter } from '../adapter/fields';
7
7
  import type { ErrorCodes } from '../adapter/types';
8
8
  import type { ValidatorTypes } from '../validators/types';
9
- import type Validator from '../validators/utils';
9
+ import type { Validator } from '../validators/utils';
10
10
 
11
11
  export type OnlyFieldAdaptersFromSchemaAdapter = keyof {
12
12
  [key in keyof SchemaAdapter as SchemaAdapter[key] extends FieldAdapter ? key : never]: SchemaAdapter[key];
@@ -1,17 +1,17 @@
1
- import Schema from './schema';
1
+ import { Schema } from './schema';
2
2
  import {
3
3
  defaultTransform,
4
4
  defaultTransformToAdapter,
5
5
  transformSchemaAndCheckIfShouldBeHandledByFallbackOnComplexSchemas
6
6
  } from '../utils';
7
7
  import { unionValidation } from '../validators/union';
8
- import Validator from '../validators/utils';
8
+ import { Validator } from '../validators/utils';
9
9
 
10
10
  import type { DefinitionsOfSchemaType, ExtractTypeFromUnionOfSchemas } from './types';
11
- import type FieldAdapter from '../adapter/fields';
11
+ import type { FieldAdapter } from '../adapter/fields';
12
12
  import type { Narrow } from '@palmares/core';
13
13
 
14
- export default class UnionSchema<
14
+ export class UnionSchema<
15
15
  TType extends {
16
16
  input: unknown;
17
17
  validate: unknown;
package/src/types.ts CHANGED
@@ -1,5 +1,5 @@
1
- import type SchemaAdapter from './adapter';
2
- import type Schema from './schema/schema';
1
+ import type { SchemaAdapter } from './adapter';
2
+ import type { Schema } from './schema/schema';
3
3
  import type { ValidatorTypes } from './validators/types';
4
4
 
5
5
  export type MaybePromise<T> = T | Promise<T>;
package/src/utils.ts CHANGED
@@ -1,11 +1,11 @@
1
- import SchemaAdapter from './adapter';
1
+ import { SchemaAdapter } from './adapter';
2
2
  import { getDefaultAdapter } from './conf';
3
3
  import { checkType, nullable, optional } from './validators/schema';
4
- import Validator from './validators/utils';
4
+ import { Validator } from './validators/utils';
5
5
 
6
- import type FieldAdapter from './adapter/fields';
6
+ import type { FieldAdapter } from './adapter/fields';
7
7
  import type { ValidationDataBasedOnType } from './adapter/types';
8
- import type Schema from './schema/schema';
8
+ import type { Schema } from './schema/schema';
9
9
  import type { ValidationFallbackCallbackReturnType, ValidationFallbackReturnType } from './schema/types';
10
10
  import type { FallbackFunctionsType, SupportedSchemas } from './types';
11
11
 
@@ -14,7 +14,7 @@ import type { FallbackFunctionsType, SupportedSchemas } from './types';
14
14
  * our schema definition, it can return an instance of this class and with this instance we are able to
15
15
  * fallback to our default implementation of the schema validation.
16
16
  */
17
- export default class WithFallback<TType extends SupportedSchemas> {
17
+ export class WithFallback<TType extends SupportedSchemas> {
18
18
  fallbackFor: Set<
19
19
  | keyof Omit<ValidationDataBasedOnType<TType>, 'withFallback' | 'parsers'>
20
20
  | keyof ValidationDataBasedOnType<TType>['parsers']
@@ -1,5 +1,5 @@
1
- import type ArraySchema from '../schema/array';
2
- import type Schema from '../schema/schema';
1
+ import type { ArraySchema } from '../schema/array';
2
+ import type { Schema } from '../schema/schema';
3
3
  import type { ValidationFallbackCallbackReturnType, ValidationFallbackReturnType } from '../schema/types';
4
4
 
5
5
  export function arrayValidation(isTuple: boolean, schemas: Schema<any, any>[]): ValidationFallbackReturnType {
@@ -1,4 +1,4 @@
1
- import type Schema from '../schema/schema';
1
+ import type { Schema } from '../schema/schema';
2
2
  import type { ValidationFallbackReturnType } from '../schema/types';
3
3
 
4
4
  export function booleanValidation(): ValidationFallbackReturnType {
@@ -1,5 +1,5 @@
1
- import type DatetimeSchema from '../schema/datetime';
2
- import type Schema from '../schema/schema';
1
+ import type { DatetimeSchema } from '../schema/datetime';
2
+ import type { Schema } from '../schema/schema';
3
3
  import type { ValidationFallbackReturnType } from '../schema/types';
4
4
 
5
5
  export function datetimeValidation(): ValidationFallbackReturnType {
@@ -1,5 +1,5 @@
1
- import type NumberSchema from '../schema/number';
2
- import type Schema from '../schema/schema';
1
+ import type { NumberSchema } from '../schema/number';
2
+ import type { Schema } from '../schema/schema';
3
3
  import type { ValidationFallbackReturnType } from '../schema/types';
4
4
 
5
5
  export function numberValidation(): ValidationFallbackReturnType {
@@ -1,4 +1,4 @@
1
- import type Schema from '../schema/schema';
1
+ import type { Schema } from '../schema/schema';
2
2
  import type { ValidationFallbackCallbackReturnType, ValidationFallbackReturnType } from '../schema/types';
3
3
 
4
4
  export function objectValidation(keysToFallback: { [key: string]: Schema }): ValidationFallbackReturnType {
@@ -1,8 +1,8 @@
1
1
  import type { ErrorCodes } from '../adapter/types';
2
- import type BooleanSchema from '../schema/boolean';
3
- import type NumberSchema from '../schema/number';
4
- import type Schema from '../schema/schema';
5
- import type StringSchema from '../schema/string';
2
+ import type { BooleanSchema } from '../schema/boolean';
3
+ import type { NumberSchema } from '../schema/number';
4
+ import type { Schema } from '../schema/schema';
5
+ import type { StringSchema } from '../schema/string';
6
6
  import type { ValidationFallbackReturnType } from '../schema/types';
7
7
 
8
8
  export function optional(args: Schema['__optional']): ValidationFallbackReturnType {
@@ -1,7 +1,7 @@
1
1
  import { type ValidationFallbackReturnType } from '../schema/types';
2
2
 
3
- import type Schema from '../schema/schema';
4
- import type StringSchema from '../schema/string';
3
+ import type { Schema } from '../schema/schema';
4
+ import type { StringSchema } from '../schema/string';
5
5
 
6
6
  export function stringValidation(): ValidationFallbackReturnType {
7
7
  return {
@@ -1,4 +1,4 @@
1
- import type Schema from '../schema/schema';
1
+ import type { Schema } from '../schema/schema';
2
2
  import type { ValidationFallbackReturnType } from '../schema/types';
3
3
 
4
4
  export function unionValidation(
@@ -1,6 +1,6 @@
1
1
  import type { ValidatorTypes } from './types';
2
2
  import type { ErrorCodes } from '../adapter/types';
3
- import type Schema from '../schema/schema';
3
+ import type { Schema } from '../schema/schema';
4
4
  import type {
5
5
  ValidationFallbackCallbackReturnType,
6
6
  ValidationFallbackCallbackType,
@@ -42,7 +42,7 @@ const typeByPriority = Object.entries(priorityByType).reduce(
42
42
  * That's what this solve, it's a better approach than repeating the same code 3 times on the schema. It's also
43
43
  * more powerful, because if we need to add any extra priorities we can do that easily without changing the schema.
44
44
  */
45
- export default class Validator {
45
+ export class Validator {
46
46
  child?: Validator;
47
47
  parent?: Validator;
48
48
  fallbackNamesAdded = new Set();