@palmares/schemas 0.0.1 → 0.1.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 (174) hide show
  1. package/.turbo/turbo-build$colon$watch.log +12 -410
  2. package/CHANGELOG.md +17 -0
  3. package/__tests__/.drizzle/migrations/0000_skinny_harrier.sql +22 -0
  4. package/__tests__/.drizzle/migrations/meta/0000_snapshot.json +156 -0
  5. package/__tests__/.drizzle/migrations/meta/_journal.json +13 -0
  6. package/__tests__/.drizzle/schema.ts +35 -0
  7. package/__tests__/drizzle.config.ts +11 -0
  8. package/__tests__/eslint.config.js +10 -0
  9. package/__tests__/manage.ts +5 -0
  10. package/__tests__/node_modules/.bin/drizzle-kit +17 -0
  11. package/__tests__/node_modules/.bin/esbuild +14 -0
  12. package/__tests__/node_modules/.bin/tsc +17 -0
  13. package/__tests__/node_modules/.bin/tsserver +17 -0
  14. package/__tests__/node_modules/.bin/tsx +17 -0
  15. package/__tests__/package.json +36 -0
  16. package/__tests__/sqlite.db +0 -0
  17. package/__tests__/src/core/array.test.ts +130 -0
  18. package/__tests__/src/core/boolean.test.ts +66 -0
  19. package/__tests__/src/core/datetime.test.ts +102 -0
  20. package/__tests__/src/core/index.ts +35 -0
  21. package/__tests__/src/core/model.test.ts +260 -0
  22. package/__tests__/src/core/models.ts +50 -0
  23. package/__tests__/src/core/numbers.test.ts +177 -0
  24. package/__tests__/src/core/object.test.ts +198 -0
  25. package/__tests__/src/core/string.test.ts +222 -0
  26. package/__tests__/src/core/test.test.ts +59 -0
  27. package/__tests__/src/core/types.test.ts +97 -0
  28. package/__tests__/src/core/union.test.ts +99 -0
  29. package/__tests__/src/settings.ts +71 -0
  30. package/__tests__/tsconfig.json +11 -0
  31. package/dist/cjs/src/adapter/fields/index.js +2 -2
  32. package/dist/cjs/src/adapter/fields/object.js +9 -0
  33. package/dist/cjs/src/adapter/index.js +1 -0
  34. package/dist/cjs/src/constants.js +1 -7
  35. package/dist/cjs/src/domain.js +146 -1
  36. package/dist/cjs/src/index.js +69 -74
  37. package/dist/cjs/src/model.js +206 -206
  38. package/dist/cjs/src/schema/array.js +185 -58
  39. package/dist/cjs/src/schema/boolean.js +105 -44
  40. package/dist/cjs/src/schema/datetime.js +104 -38
  41. package/dist/cjs/src/schema/number.js +134 -114
  42. package/dist/cjs/src/schema/object.js +106 -43
  43. package/dist/cjs/src/schema/schema.js +123 -75
  44. package/dist/cjs/src/schema/string.js +152 -58
  45. package/dist/cjs/src/schema/union.js +412 -290
  46. package/dist/cjs/src/utils.js +42 -15
  47. package/dist/cjs/src/validators/array.js +6 -1
  48. package/dist/cjs/src/validators/boolean.js +2 -0
  49. package/dist/cjs/src/validators/datetime.js +4 -0
  50. package/dist/cjs/src/validators/number.js +12 -40
  51. package/dist/cjs/src/validators/object.js +1 -0
  52. package/dist/cjs/src/validators/schema.js +5 -1
  53. package/dist/cjs/src/validators/string.js +30 -2
  54. package/dist/cjs/src/validators/union.js +5 -4
  55. package/dist/cjs/src/validators/utils.js +99 -27
  56. package/dist/cjs/tsconfig.types.tsbuildinfo +1 -1
  57. package/dist/cjs/types/adapter/fields/array.d.ts +2 -2
  58. package/dist/cjs/types/adapter/fields/array.d.ts.map +1 -1
  59. package/dist/cjs/types/adapter/fields/boolean.d.ts.map +1 -1
  60. package/dist/cjs/types/adapter/fields/datetime.d.ts.map +1 -1
  61. package/dist/cjs/types/adapter/fields/index.d.ts +2 -2
  62. package/dist/cjs/types/adapter/fields/index.d.ts.map +1 -1
  63. package/dist/cjs/types/adapter/fields/number.d.ts.map +1 -1
  64. package/dist/cjs/types/adapter/fields/object.d.ts +2 -1
  65. package/dist/cjs/types/adapter/fields/object.d.ts.map +1 -1
  66. package/dist/cjs/types/adapter/fields/string.d.ts.map +1 -1
  67. package/dist/cjs/types/adapter/fields/union.d.ts.map +1 -1
  68. package/dist/cjs/types/adapter/index.d.ts +1 -0
  69. package/dist/cjs/types/adapter/index.d.ts.map +1 -1
  70. package/dist/cjs/types/adapter/types.d.ts +28 -18
  71. package/dist/cjs/types/adapter/types.d.ts.map +1 -1
  72. package/dist/cjs/types/constants.d.ts +0 -1
  73. package/dist/cjs/types/constants.d.ts.map +1 -1
  74. package/dist/cjs/types/domain.d.ts +5 -4
  75. package/dist/cjs/types/domain.d.ts.map +1 -1
  76. package/dist/cjs/types/index.d.ts +78 -55
  77. package/dist/cjs/types/index.d.ts.map +1 -1
  78. package/dist/cjs/types/model.d.ts +17 -17
  79. package/dist/cjs/types/model.d.ts.map +1 -1
  80. package/dist/cjs/types/schema/array.d.ts +168 -47
  81. package/dist/cjs/types/schema/array.d.ts.map +1 -1
  82. package/dist/cjs/types/schema/boolean.d.ts +103 -44
  83. package/dist/cjs/types/schema/boolean.d.ts.map +1 -1
  84. package/dist/cjs/types/schema/datetime.d.ts +90 -30
  85. package/dist/cjs/types/schema/datetime.d.ts.map +1 -1
  86. package/dist/cjs/types/schema/number.d.ts +133 -125
  87. package/dist/cjs/types/schema/number.d.ts.map +1 -1
  88. package/dist/cjs/types/schema/object.d.ts +104 -35
  89. package/dist/cjs/types/schema/object.d.ts.map +1 -1
  90. package/dist/cjs/types/schema/schema.d.ts +62 -44
  91. package/dist/cjs/types/schema/schema.d.ts.map +1 -1
  92. package/dist/cjs/types/schema/string.d.ts +152 -65
  93. package/dist/cjs/types/schema/string.d.ts.map +1 -1
  94. package/dist/cjs/types/schema/types.d.ts +11 -2
  95. package/dist/cjs/types/schema/types.d.ts.map +1 -1
  96. package/dist/cjs/types/schema/union.d.ts +133 -40
  97. package/dist/cjs/types/schema/union.d.ts.map +1 -1
  98. package/dist/cjs/types/types.d.ts +35 -0
  99. package/dist/cjs/types/types.d.ts.map +1 -1
  100. package/dist/cjs/types/utils.d.ts +41 -27
  101. package/dist/cjs/types/utils.d.ts.map +1 -1
  102. package/dist/cjs/types/validators/array.d.ts.map +1 -1
  103. package/dist/cjs/types/validators/boolean.d.ts.map +1 -1
  104. package/dist/cjs/types/validators/datetime.d.ts.map +1 -1
  105. package/dist/cjs/types/validators/number.d.ts +5 -6
  106. package/dist/cjs/types/validators/number.d.ts.map +1 -1
  107. package/dist/cjs/types/validators/object.d.ts.map +1 -1
  108. package/dist/cjs/types/validators/schema.d.ts +2 -2
  109. package/dist/cjs/types/validators/schema.d.ts.map +1 -1
  110. package/dist/cjs/types/validators/string.d.ts +9 -9
  111. package/dist/cjs/types/validators/string.d.ts.map +1 -1
  112. package/dist/cjs/types/validators/utils.d.ts +44 -27
  113. package/dist/cjs/types/validators/utils.d.ts.map +1 -1
  114. package/dist/esm/src/adapter/fields/index.js +2 -2
  115. package/dist/esm/src/adapter/fields/object.js +6 -0
  116. package/dist/esm/src/adapter/index.js +1 -0
  117. package/dist/esm/src/constants.js +1 -2
  118. package/dist/esm/src/domain.js +11 -1
  119. package/dist/esm/src/index.js +38 -73
  120. package/dist/esm/src/model.js +83 -78
  121. package/dist/esm/src/schema/array.js +136 -54
  122. package/dist/esm/src/schema/boolean.js +98 -44
  123. package/dist/esm/src/schema/datetime.js +91 -38
  124. package/dist/esm/src/schema/number.js +127 -110
  125. package/dist/esm/src/schema/object.js +98 -43
  126. package/dist/esm/src/schema/schema.js +102 -67
  127. package/dist/esm/src/schema/string.js +147 -59
  128. package/dist/esm/src/schema/union.js +119 -40
  129. package/dist/esm/src/types.js +14 -1
  130. package/dist/esm/src/utils.js +56 -27
  131. package/dist/esm/src/validators/array.js +6 -1
  132. package/dist/esm/src/validators/boolean.js +2 -0
  133. package/dist/esm/src/validators/datetime.js +4 -0
  134. package/dist/esm/src/validators/number.js +9 -23
  135. package/dist/esm/src/validators/object.js +1 -0
  136. package/dist/esm/src/validators/schema.js +5 -1
  137. package/dist/esm/src/validators/string.js +30 -2
  138. package/dist/esm/src/validators/union.js +5 -4
  139. package/dist/esm/src/validators/utils.js +62 -36
  140. package/package.json +3 -3
  141. package/src/adapter/fields/array.ts +2 -2
  142. package/src/adapter/fields/boolean.ts +3 -8
  143. package/src/adapter/fields/datetime.ts +3 -9
  144. package/src/adapter/fields/index.ts +11 -11
  145. package/src/adapter/fields/number.ts +3 -9
  146. package/src/adapter/fields/object.ts +13 -10
  147. package/src/adapter/fields/string.ts +3 -9
  148. package/src/adapter/fields/union.ts +3 -9
  149. package/src/adapter/index.ts +1 -0
  150. package/src/adapter/types.ts +60 -45
  151. package/src/constants.ts +1 -3
  152. package/src/domain.ts +15 -1
  153. package/src/index.ts +189 -211
  154. package/src/model.ts +119 -115
  155. package/src/schema/array.ts +274 -90
  156. package/src/schema/boolean.ts +145 -60
  157. package/src/schema/datetime.ts +133 -49
  158. package/src/schema/number.ts +210 -173
  159. package/src/schema/object.ts +167 -74
  160. package/src/schema/schema.ts +205 -126
  161. package/src/schema/string.ts +221 -94
  162. package/src/schema/types.ts +44 -16
  163. package/src/schema/union.ts +193 -68
  164. package/src/types.ts +53 -0
  165. package/src/utils.ts +115 -57
  166. package/src/validators/array.ts +46 -27
  167. package/src/validators/boolean.ts +13 -7
  168. package/src/validators/datetime.ts +24 -16
  169. package/src/validators/number.ts +53 -63
  170. package/src/validators/object.ts +6 -5
  171. package/src/validators/schema.ts +33 -25
  172. package/src/validators/string.ts +122 -59
  173. package/src/validators/union.ts +8 -8
  174. package/src/validators/utils.ts +67 -42
@@ -7,48 +7,46 @@ export default class NumberSchema<TType extends {
7
7
  output: any;
8
8
  representation: any;
9
9
  } = {
10
- input: number | bigint;
11
- output: number | bigint;
12
- validate: number | bigint;
13
- internal: number | bigint;
14
- representation: number | bigint;
10
+ input: number;
11
+ output: number;
12
+ validate: number;
13
+ internal: number;
14
+ representation: number;
15
15
  }, TDefinitions extends DefinitionsOfSchemaType = DefinitionsOfSchemaType> extends Schema<TType, TDefinitions> {
16
- protected __is: {
16
+ protected __allowString: boolean;
17
+ protected __is?: {
17
18
  value: TType['input'][];
18
19
  message: string;
19
20
  };
20
- protected __integer: {
21
+ protected __integer?: {
21
22
  message: string;
22
23
  };
23
- protected __maxDigits: {
24
+ protected __maxDigits?: {
24
25
  value: number;
25
26
  message: string;
26
27
  };
27
- protected __decimalPlaces: {
28
+ protected __decimalPlaces?: {
28
29
  value: number;
29
30
  message: string;
30
31
  };
31
- protected __max: {
32
+ protected __max?: {
32
33
  value: number;
33
34
  inclusive: boolean;
34
35
  message: string;
35
36
  };
36
- protected __min: {
37
+ protected __min?: {
37
38
  value: number;
38
39
  inclusive: boolean;
39
40
  message: string;
40
41
  };
41
- protected __allowNegative: {
42
- allowZero: boolean;
43
- message: string;
44
- };
45
- protected __allowPositive: {
46
- allowZero: boolean;
42
+ protected __type: {
47
43
  message: string;
44
+ check: (value: TType['input']) => boolean;
48
45
  };
49
46
  protected __transformToAdapter(options: Parameters<Schema['__transformToAdapter']>[0]): Promise<any>;
50
47
  /**
51
- * This let's you refine the schema with custom validations. This is useful when you want to validate something that is not supported by default by the schema adapter.
48
+ * This let's you refine the schema with custom validations. This is useful when you want to validate something
49
+ * that is not supported by default by the schema adapter.
52
50
  *
53
51
  * @example
54
52
  * ```typescript
@@ -60,7 +58,8 @@ export default class NumberSchema<TType extends {
60
58
  *
61
59
  * const { errors, parsed } = await numberSchema.parse(-1);
62
60
  *
63
- * console.log(errors); // [{ isValid: false, code: 'invalid_number', message: 'The number should be greater than 0', path: [] }]
61
+ * console.log(errors);
62
+ * // [{ isValid: false, code: 'invalid_number', message: 'The number should be greater than 0', path: [] }]
64
63
  * ```
65
64
  *
66
65
  * @param refinementCallback - The callback that will be called to validate the value.
@@ -117,8 +116,29 @@ export default class NumberSchema<TType extends {
117
116
  representation: TType["representation"] | undefined | null;
118
117
  }, TDefinitions>;
119
118
  /**
120
- * Allows the value to be null and ONLY null. You can also use this function to set a custom message when the value is NULL by setting
121
- * the { message: 'Your custom message', allow: false } on the options.
119
+ * Just adds a message when the value is undefined. It's just a syntax sugar for
120
+ *
121
+ * ```typescript
122
+ * p.string().optional({ message: 'This value cannot be null', allow: false })
123
+ * ```
124
+ *
125
+ * @param options - The options of nonOptional function
126
+ * @param options.message - A custom message if the value is undefined.
127
+ *
128
+ * @returns - The schema.
129
+ */
130
+ nonOptional(options?: {
131
+ message: string;
132
+ }): NumberSchema<{
133
+ input: TType["input"];
134
+ validate: TType["validate"];
135
+ internal: TType["internal"];
136
+ output: TType["output"];
137
+ representation: TType["representation"];
138
+ }, TDefinitions>;
139
+ /**
140
+ * Allows the value to be null and ONLY null. You can also use this function to set a custom message when the value
141
+ * is NULL by setting the { message: 'Your custom message', allow: false } on the options.
122
142
  *
123
143
  * @example
124
144
  * ```typescript
@@ -152,14 +172,37 @@ export default class NumberSchema<TType extends {
152
172
  representation: TType["representation"] | null;
153
173
  }, TDefinitions>;
154
174
  /**
155
- * This method will remove the value from the representation of the schema. If the value is undefined it will keep that way
156
- * otherwise it will set the value to undefined after it's validated.
175
+ * Just adds a message when the value is null. It's just a syntax sugar for
176
+ *
177
+ * ```typescript
178
+ * p.string().nullable({ message: 'This value cannot be null', allow: false })
179
+ * ```
180
+ *
181
+ * @param options - The options of nonNullable function
182
+ * @param options.message - A custom message if the value is null.
183
+ *
184
+ * @returns - The schema.
185
+ */
186
+ nonNullable(options?: {
187
+ message: string;
188
+ }): NumberSchema<{
189
+ input: TType["input"];
190
+ validate: TType["validate"];
191
+ internal: TType["internal"];
192
+ output: TType["output"];
193
+ representation: TType["representation"];
194
+ }, TDefinitions>;
195
+ /**
196
+ * This method will remove the value from the representation of the schema. If the value is undefined it will keep
197
+ * that way otherwise it will set the value to undefined after it's validated.
157
198
  * This is used in conjunction with the {@link data} function, the {@link parse} function or {@link validate}
158
199
  * function. This will remove the value from the representation of the schema.
159
200
  *
160
- * By default, the value will be removed just from the representation, in other words, when you call the {@link data} function.
161
- * But if you want to remove the value from the internal representation, you can pass the argument `toInternal` as true.
162
- * Then if you still want to remove the value from the representation, you will need to pass the argument `toRepresentation` as true as well.
201
+ * By default, the value will be removed just from the representation, in other words, when you call the {@link data}
202
+ * function.
203
+ * But if you want to remove the value from the internal representation, you can pass the argument `toInternal`
204
+ * as true. Then if you still want to remove the value from the representation, you will need to pass the argument
205
+ * `toRepresentation` as true as well.
163
206
  *
164
207
  * @example
165
208
  * ```typescript
@@ -181,9 +224,11 @@ export default class NumberSchema<TType extends {
181
224
  * ```
182
225
  *
183
226
  *
184
- * @param args - By default, the value will be removed just from the representation, in other words, when you call the {@link data} function.
185
- * But if you want to remove the value from the internal representation, you can pass the argument `toInternal` as true.
186
- * Then if you still want to remove the value from the representation, you will need to pass the argument `toRepresentation` as true as well.
227
+ * @param args - By default, the value will be removed just from the representation, in other words, when you call
228
+ * the {@link data} function.
229
+ * But if you want to remove the value from the internal representation, you can pass the argument `toInternal`
230
+ * as true. Then if you still want to remove the value from the representation, you will need to pass the argument
231
+ * `toRepresentation` as true as well.
187
232
  *
188
233
  * @returns The schema.
189
234
  */
@@ -199,9 +244,27 @@ export default class NumberSchema<TType extends {
199
244
  representation: TToRepresentation extends true ? undefined : TType["representation"];
200
245
  }, TDefinitions>;
201
246
  /**
202
- * This function is used in conjunction with the {@link validate} function. It's used to save a value to an external source
203
- * like a database. You should always return the schema after you save the value, that way we will always have the correct type
204
- * of the schema after the save operation.
247
+ * This will allow the value to be a string, it does not validate, it just parses inputs as strings and allows the
248
+ * result to be a string as well.
249
+ *
250
+ * @example
251
+ * ```ts
252
+ * number().allowString().parse('true') // true
253
+ * ```
254
+ *
255
+ * @returns - The schema instance
256
+ */
257
+ allowString(): NumberSchema<{
258
+ input: string | TType["input"];
259
+ output: string | TType["output"];
260
+ internal: string | TType["internal"];
261
+ representation: string | TType["representation"];
262
+ validate: string | TType["validate"];
263
+ }, TDefinitions>;
264
+ /**
265
+ * This function is used in conjunction with the {@link validate} function. It's used to save a value to an external
266
+ * source like a database. You should always return the schema after you save the value, that way we will always
267
+ * have the correct type of the schema after the save operation.
205
268
  *
206
269
  * You can use the {@link toRepresentation} function to transform and clean the value it returns after the save.
207
270
  *
@@ -250,7 +313,8 @@ export default class NumberSchema<TType extends {
250
313
  hasSave: true;
251
314
  }>;
252
315
  /**
253
- * This function is used to add a default value to the schema. If the value is either undefined or null, the default value will be used.
316
+ * This function is used to add a default value to the schema. If the value is either undefined or null, the default
317
+ * value will be used.
254
318
  *
255
319
  * @example
256
320
  * ```typescript
@@ -271,8 +335,9 @@ export default class NumberSchema<TType extends {
271
335
  representation: TType["representation"];
272
336
  }, TDefinitions>;
273
337
  /**
274
- * This function let's you customize the schema your own way. After we translate the schema on the adapter we call this function to let you customize
275
- * the custom schema your own way. Our API does not support passthrough? No problem, you can use this function to customize the zod schema.
338
+ * This function let's you customize the schema your own way. After we translate the schema on the adapter we call
339
+ * this function to let you customize the custom schema your own way. Our API does not support passthrough?
340
+ * No problem, you can use this function to customize the zod schema.
276
341
  *
277
342
  * @example
278
343
  * ```typescript
@@ -284,19 +349,21 @@ export default class NumberSchema<TType extends {
284
349
  *
285
350
  * const { errors, parsed } = await numberSchema.parse(-1);
286
351
  *
287
- * console.log(errors); // [{ isValid: false, code: 'nonnegative', message: 'The number should be nonnegative', path: [] }]
352
+ * console.log(errors);
353
+ * // [{ isValid: false, code: 'nonnegative', message: 'The number should be nonnegative', path: [] }]
288
354
  * ```
289
355
  *
290
356
  * @param callback - The callback that will be called to customize the schema.
291
- * @param toStringCallback - The callback that will be called to transform the schema to a string when you want to compile the underlying schema
292
- * to a string so you can save it for future runs.
357
+ * @param toStringCallback - The callback that will be called to transform the schema to a string when you
358
+ * want to compile the underlying schema to a string so you can save it for future runs.
293
359
  *
294
360
  * @returns The schema.
295
361
  */
296
362
  extends(callback: (schema: Awaited<ReturnType<NonNullable<TDefinitions['schemaAdapter']['number']>['translate']>>) => Awaited<ReturnType<NonNullable<TDefinitions['schemaAdapter']['field']>['translate']>> | any, toStringCallback?: (schemaAsString: string) => string): this;
297
363
  /**
298
- * This function is used to transform the value to the representation of the schema. When using the {@link data} function. With this function you have full
299
- * control to add data cleaning for example, transforming the data and whatever. Another use case is when you want to return deeply nested recursive data.
364
+ * This function is used to transform the value to the representation of the schema. When using the {@link data}
365
+ * function. With this function you have full control to add data cleaning for example, transforming the data and
366
+ * whatever. Another use case is when you want to return deeply nested recursive data.
300
367
  * The schema maps to itself.
301
368
  *
302
369
  * @example
@@ -345,8 +412,9 @@ export default class NumberSchema<TType extends {
345
412
  representation: TRepresentation;
346
413
  }, TDefinitions>;
347
414
  /**
348
- * This function is used to transform the value to the internal representation of the schema. This is useful when you want to transform the value
349
- * to a type that the schema adapter can understand. For example, you might want to transform a string to a date. This is the function you use.
415
+ * This function is used to transform the value to the internal representation of the schema. This is useful when
416
+ * you want to transform the value to a type that the schema adapter can understand. For example, you might want
417
+ * to transform a string to a date. This is the function you use.
350
418
  *
351
419
  * @example
352
420
  * ```typescript
@@ -384,7 +452,8 @@ export default class NumberSchema<TType extends {
384
452
  representation: TType["representation"];
385
453
  }, TDefinitions>;
386
454
  /**
387
- * Called before the validation of the schema. Let's say that you want to validate a date that might receive a string, you can convert that string to a date
455
+ * Called before the validation of the schema. Let's say that you want to validate a date that might receive a string,
456
+ * you can convert that string to a date
388
457
  * here BEFORE the validation. This pretty much transforms the value to a type that the schema adapter can understand.
389
458
  *
390
459
  * @example
@@ -430,7 +499,7 @@ export default class NumberSchema<TType extends {
430
499
  *
431
500
  * @returns - The schema instance
432
501
  */
433
- is<const TValue extends TType['input'][]>(value: TValue): Schema<{
502
+ is<const TValue extends TType['input'][]>(value: TValue, options?: Partial<Omit<NonNullable<NumberSchema['__is']>, 'value'>>): Schema<{
434
503
  input: TValue[number];
435
504
  output: TValue[number];
436
505
  internal: TValue[number];
@@ -438,7 +507,8 @@ export default class NumberSchema<TType extends {
438
507
  validate: TValue[number];
439
508
  }, TDefinitions>;
440
509
  /**
441
- * Allows only numbers that are less than the value passed. If you want to allow the number to be equal to the value, you can pass the option `inclusive` as `true`.
510
+ * Allows only numbers that are less than the value passed. If you want to allow the number to be equal to the value,
511
+ * you can pass the option `inclusive` as `true`.
442
512
  * Otherwise, it will only allow numbers less than the value.
443
513
  *
444
514
  * @example
@@ -469,7 +539,8 @@ export default class NumberSchema<TType extends {
469
539
  is: never;
470
540
  };
471
541
  /**
472
- * This method will validate if the number is greater than the value passed. If you want to allow the number to be equal to the value, you can pass the option `inclusive` as `true`.
542
+ * This method will validate if the number is greater than the value passed. If you want to allow the number to be
543
+ * equal to the value, you can pass the option `inclusive` as `true`.
473
544
  * Otherwise, it will only allow numbers greater than the value.
474
545
  *
475
546
  * @example
@@ -498,72 +569,8 @@ export default class NumberSchema<TType extends {
498
569
  message?: string;
499
570
  }): this;
500
571
  /**
501
- * Allows only negative numbers. If you want to allow zero, you can pass the option `allowZero` as `true`. Otherwise, it will only allow negative numbers.
502
- *
503
- * @example
504
- * ```typescript
505
- * import * as p from '@palmares/schema';
506
- *
507
- * const schema = p.number().negative();
508
- *
509
- * schema.parse(-10); // { errors: [], parsed: -10 }
510
- * schema.parse(0); // { errors: [{ code: 'negative', message: 'The number should be negative' }], parsed: 0 }
511
- *
512
- * const schema = p.number().negative({ allowZero: true });
513
- *
514
- * schema.parse(0); // { errors: [], parsed: 0 }
515
- * ```
516
- *
517
- * @param options - The options to be passed to the validation
518
- * @param options.allowZero - If you want to allow zero, you can pass this option as `true`. Otherwise, it will only allow negative numbers.
519
- * @param options.message - The message to be returned if the validation fails
520
- *
521
- * @returns - The schema instance
522
- */
523
- negative(options?: {
524
- allowZero?: boolean;
525
- message?: string;
526
- }): NumberSchema<{
527
- input: TType["input"];
528
- output: TType["output"];
529
- representation: TType["representation"];
530
- internal: TType["internal"];
531
- validate: TType["validate"];
532
- }, TDefinitions>;
533
- /**
534
- * Allows only positive numbers. If you want to allow zero, you can pass the option `allowZero` as `true`. Otherwise, it will only allow positive numbers greater than zero.
535
- *
536
- * @example
537
- * ```typescript
538
- * import * as p from '@palmares/schema';
539
- *
540
- * const schema = p.number().positive();
541
- *
542
- * schema.parse(10); // { errors: [], parsed: 10 }
543
- * schema.parse(0); // { errors: [{ code: 'positive', message: 'The number should be positive' }], parsed: 0 }
544
- *
545
- * const schema = p.number().positive({ allowZero: true });
546
- * schema.parse(0); // { errors: [], parsed: 0 }
547
- * ```
548
- *
549
- * @param options - The options to be passed to the validation
550
- * @param options.allowZero - If you want to allow zero, you can pass this option as `true`. Otherwise, it will only allow positive numbers greater than zero.
551
- * @param options.message - The message to be returned if the validation fails
552
- *
553
- * @returns - The schema instance
554
- */
555
- positive(options?: {
556
- allowZero?: boolean;
557
- message?: string;
558
- }): NumberSchema<{
559
- input: TType["input"];
560
- output: TType["output"];
561
- representation: TType["representation"];
562
- internal: TType["internal"];
563
- validate: TType["validate"];
564
- }, TDefinitions>;
565
- /**
566
- * This method will validate the number to have the exact number of decimal places. It's usually useful for decimal numbers like currencies.
572
+ * This method will validate the number to have the exact number of decimal places. It's usually useful for decimal
573
+ * numbers like currencies.
567
574
  *
568
575
  * @example
569
576
  * ```
@@ -571,7 +578,8 @@ export default class NumberSchema<TType extends {
571
578
  *
572
579
  * schema.parse(10.00); // { errors: [], parsed: 10.00}
573
580
  *
574
- * schema.parse(10.000); // { errors: [{ code: 'decimal_places', message: 'The number should have 2 decimal places' }], parsed: 10.000}
581
+ * schema.parse(10.000);
582
+ * // { errors: [{ code: 'decimal_places', message: 'The number should have 2 decimal places' }], parsed: 10.000}
575
583
  * ```
576
584
  *
577
585
  * @param value - The number of decimal places.
@@ -590,8 +598,8 @@ export default class NumberSchema<TType extends {
590
598
  validate: TType["validate"];
591
599
  }, TDefinitions>;
592
600
  /**
593
- * This method will validate the number to have at most the number of digits specified. If used in conjunction with {@link decimalPlaces}, this number should be bigger than the
594
- * value of the decimal places.
601
+ * This method will validate the number to have at most the number of digits specified. If used in conjunction with
602
+ * {@link decimalPlaces}, this number should be bigger than the value of the decimal places.
595
603
  *
596
604
  * Think about that
597
605
  *
@@ -650,18 +658,18 @@ export default class NumberSchema<TType extends {
650
658
  validate: TType["validate"];
651
659
  }, TDefinitions>;
652
660
  static new<TDefinitions extends DefinitionsOfSchemaType>(): NumberSchema<{
653
- input: number | bigint;
654
- output: number | bigint;
655
- internal: number | bigint;
656
- representation: number | bigint;
657
- validate: number | bigint;
661
+ input: number;
662
+ output: number;
663
+ internal: number;
664
+ representation: number;
665
+ validate: number;
658
666
  }, TDefinitions>;
659
667
  }
660
668
  export declare const number: <TDefinitions extends DefinitionsOfSchemaType>() => NumberSchema<{
661
- input: number | bigint;
662
- output: number | bigint;
663
- internal: number | bigint;
664
- representation: number | bigint;
665
- validate: number | bigint;
669
+ input: number;
670
+ output: number;
671
+ internal: number;
672
+ representation: number;
673
+ validate: number;
666
674
  }, TDefinitions>;
667
675
  //# sourceMappingURL=number.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"number.d.ts","sourceRoot":"","sources":["../../../../src/schema/number.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,UAAU,CAAC;AAW9B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAEvD,MAAM,CAAC,OAAO,OAAO,YAAY,CAC/B,KAAK,SAAS;IACZ,KAAK,EAAE,GAAG,CAAC;IACX,QAAQ,EAAE,GAAG,CAAC;IACd,QAAQ,EAAE,GAAG,CAAC;IACd,MAAM,EAAE,GAAG,CAAC;IACZ,cAAc,EAAE,GAAG,CAAC;CACrB,GAAG;IACF,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;IAC1B,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;IAC1B,cAAc,EAAE,MAAM,GAAG,MAAM,CAAC;CACjC,EACD,YAAY,SAAS,uBAAuB,GAAG,uBAAuB,CACtE,SAAQ,MAAM,CAAC,KAAK,EAAE,YAAY,CAAC;IACnC,SAAS,CAAC,IAAI,EAAG;QACf,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC;QACxB,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IAEF,SAAS,CAAC,SAAS,EAAG;QACpB,OAAO,EAAE,MAAM,C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