yuppi 1.2.6 → 1.2.8

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 (84) hide show
  1. package/README.md +4 -2
  2. package/dist/main.d.mts +139 -17
  3. package/dist/main.d.ts +139 -17
  4. package/dist/main.js +47 -42
  5. package/dist/main.mjs +47 -42
  6. package/package.json +3 -3
  7. package/dist/Patterns.barrel-D-k3IHDq.d.mts +0 -20
  8. package/dist/Patterns.barrel-JdN3lL2Q.d.ts +0 -20
  9. package/dist/Yuppi.class.d.mts +0 -24
  10. package/dist/Yuppi.class.d.ts +0 -24
  11. package/dist/Yuppi.class.js +0 -244
  12. package/dist/Yuppi.class.mjs +0 -209
  13. package/dist/barrels/Patterns.barrel.d.mts +0 -7
  14. package/dist/barrels/Patterns.barrel.d.ts +0 -7
  15. package/dist/barrels/Patterns.barrel.js +0 -62
  16. package/dist/barrels/Patterns.barrel.mjs +0 -29
  17. package/dist/barrels/Types.barrel.d.mts +0 -8
  18. package/dist/barrels/Types.barrel.d.ts +0 -8
  19. package/dist/barrels/Types.barrel.js +0 -18
  20. package/dist/barrels/Types.barrel.mjs +0 -0
  21. package/dist/defaults/YuppiOptions.default.d.mts +0 -7
  22. package/dist/defaults/YuppiOptions.default.d.ts +0 -7
  23. package/dist/defaults/YuppiOptions.default.js +0 -73
  24. package/dist/defaults/YuppiOptions.default.mjs +0 -48
  25. package/dist/patterns/Any.pattern.d.mts +0 -3
  26. package/dist/patterns/Any.pattern.d.ts +0 -3
  27. package/dist/patterns/Any.pattern.js +0 -30
  28. package/dist/patterns/Any.pattern.mjs +0 -5
  29. package/dist/patterns/Domain.pattern.d.mts +0 -3
  30. package/dist/patterns/Domain.pattern.d.ts +0 -3
  31. package/dist/patterns/Domain.pattern.js +0 -30
  32. package/dist/patterns/Domain.pattern.mjs +0 -5
  33. package/dist/patterns/Email.pattern.d.mts +0 -3
  34. package/dist/patterns/Email.pattern.d.ts +0 -3
  35. package/dist/patterns/Email.pattern.js +0 -30
  36. package/dist/patterns/Email.pattern.mjs +0 -5
  37. package/dist/patterns/HTTP.pattern.d.mts +0 -3
  38. package/dist/patterns/HTTP.pattern.d.ts +0 -3
  39. package/dist/patterns/HTTP.pattern.js +0 -30
  40. package/dist/patterns/HTTP.pattern.mjs +0 -5
  41. package/dist/patterns/PhoneNumber.pattern.d.mts +0 -3
  42. package/dist/patterns/PhoneNumber.pattern.d.ts +0 -3
  43. package/dist/patterns/PhoneNumber.pattern.js +0 -30
  44. package/dist/patterns/PhoneNumber.pattern.mjs +0 -5
  45. package/dist/patterns/URI.pattern.d.mts +0 -3
  46. package/dist/patterns/URI.pattern.d.ts +0 -3
  47. package/dist/patterns/URI.pattern.js +0 -30
  48. package/dist/patterns/URI.pattern.mjs +0 -5
  49. package/dist/patterns/Username.pattern.d.mts +0 -3
  50. package/dist/patterns/Username.pattern.d.ts +0 -3
  51. package/dist/patterns/Username.pattern.js +0 -30
  52. package/dist/patterns/Username.pattern.mjs +0 -5
  53. package/dist/types/AnyObject.type.d.mts +0 -5
  54. package/dist/types/AnyObject.type.d.ts +0 -5
  55. package/dist/types/AnyObject.type.js +0 -18
  56. package/dist/types/AnyObject.type.mjs +0 -0
  57. package/dist/types/JSONSchema.type.d.mts +0 -5
  58. package/dist/types/JSONSchema.type.d.ts +0 -5
  59. package/dist/types/JSONSchema.type.js +0 -18
  60. package/dist/types/JSONSchema.type.mjs +0 -0
  61. package/dist/types/Schema.type.d.mts +0 -45
  62. package/dist/types/Schema.type.d.ts +0 -45
  63. package/dist/types/Schema.type.js +0 -18
  64. package/dist/types/Schema.type.mjs +0 -0
  65. package/dist/types/ValidateOptions.type.d.mts +0 -5
  66. package/dist/types/ValidateOptions.type.d.ts +0 -5
  67. package/dist/types/ValidateOptions.type.js +0 -18
  68. package/dist/types/ValidateOptions.type.mjs +0 -0
  69. package/dist/types/ValidationError.type.d.mts +0 -5
  70. package/dist/types/ValidationError.type.d.ts +0 -5
  71. package/dist/types/ValidationError.type.js +0 -18
  72. package/dist/types/ValidationError.type.mjs +0 -0
  73. package/dist/types/YuppiOptions.type.d.mts +0 -46
  74. package/dist/types/YuppiOptions.type.d.ts +0 -46
  75. package/dist/types/YuppiOptions.type.js +0 -18
  76. package/dist/types/YuppiOptions.type.mjs +0 -0
  77. package/dist/utils/ConvertToJSONSchema.util.d.mts +0 -7
  78. package/dist/utils/ConvertToJSONSchema.util.d.ts +0 -7
  79. package/dist/utils/ConvertToJSONSchema.util.js +0 -69
  80. package/dist/utils/ConvertToJSONSchema.util.mjs +0 -44
  81. package/dist/utils/ConvertToYup.util.d.mts +0 -12
  82. package/dist/utils/ConvertToYup.util.d.ts +0 -12
  83. package/dist/utils/ConvertToYup.util.js +0 -140
  84. package/dist/utils/ConvertToYup.util.mjs +0 -105
@@ -1,30 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/patterns/HTTP.pattern.ts
21
- var HTTP_pattern_exports = {};
22
- __export(HTTP_pattern_exports, {
23
- HTTP: () => HTTP
24
- });
25
- module.exports = __toCommonJS(HTTP_pattern_exports);
26
- var HTTP = "^(https?:\\/\\/)([a-zA-Z0-9._%+-]+(:[a-zA-Z0-9._%+-]+)?@)?([a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,}(:\\d+)?(\\/[a-zA-Z0-9._-~%!$&'()*+,;=:@/]*)?(\\?[a-zA-Z0-9._~%!$&'()*+,;=:@/?-]*)?$";
27
- // Annotate the CommonJS export names for ESM import in node:
28
- 0 && (module.exports = {
29
- HTTP
30
- });
@@ -1,5 +0,0 @@
1
- // src/patterns/HTTP.pattern.ts
2
- var HTTP = "^(https?:\\/\\/)([a-zA-Z0-9._%+-]+(:[a-zA-Z0-9._%+-]+)?@)?([a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,}(:\\d+)?(\\/[a-zA-Z0-9._-~%!$&'()*+,;=:@/]*)?(\\?[a-zA-Z0-9._~%!$&'()*+,;=:@/?-]*)?$";
3
- export {
4
- HTTP
5
- };
@@ -1,3 +0,0 @@
1
- declare const PhoneNumber = "^\\d{4}-\\d{7,12}$";
2
-
3
- export { PhoneNumber };
@@ -1,3 +0,0 @@
1
- declare const PhoneNumber = "^\\d{4}-\\d{7,12}$";
2
-
3
- export { PhoneNumber };
@@ -1,30 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/patterns/PhoneNumber.pattern.ts
21
- var PhoneNumber_pattern_exports = {};
22
- __export(PhoneNumber_pattern_exports, {
23
- PhoneNumber: () => PhoneNumber
24
- });
25
- module.exports = __toCommonJS(PhoneNumber_pattern_exports);
26
- var PhoneNumber = "^\\d{4}-\\d{7,12}$";
27
- // Annotate the CommonJS export names for ESM import in node:
28
- 0 && (module.exports = {
29
- PhoneNumber
30
- });
@@ -1,5 +0,0 @@
1
- // src/patterns/PhoneNumber.pattern.ts
2
- var PhoneNumber = "^\\d{4}-\\d{7,12}$";
3
- export {
4
- PhoneNumber
5
- };
@@ -1,3 +0,0 @@
1
- declare const URI = "^([a-zA-Z][a-zA-Z0-9+\\-.]*:\\/\\/)([a-zA-Z0-9._%+-]+(:[a-zA-Z0-9._%+-]+)?@)?([a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,}(:\\d+)?(\\/[a-zA-Z0-9._-~%!$&'()*+,;=:@/]*)?(\\?[a-zA-Z0-9._~%!$&'()*+,;=:@/?-]*)?$";
2
-
3
- export { URI };
@@ -1,3 +0,0 @@
1
- declare const URI = "^([a-zA-Z][a-zA-Z0-9+\\-.]*:\\/\\/)([a-zA-Z0-9._%+-]+(:[a-zA-Z0-9._%+-]+)?@)?([a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,}(:\\d+)?(\\/[a-zA-Z0-9._-~%!$&'()*+,;=:@/]*)?(\\?[a-zA-Z0-9._~%!$&'()*+,;=:@/?-]*)?$";
2
-
3
- export { URI };
@@ -1,30 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/patterns/URI.pattern.ts
21
- var URI_pattern_exports = {};
22
- __export(URI_pattern_exports, {
23
- URI: () => URI
24
- });
25
- module.exports = __toCommonJS(URI_pattern_exports);
26
- var URI = "^([a-zA-Z][a-zA-Z0-9+\\-.]*:\\/\\/)([a-zA-Z0-9._%+-]+(:[a-zA-Z0-9._%+-]+)?@)?([a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,}(:\\d+)?(\\/[a-zA-Z0-9._-~%!$&'()*+,;=:@/]*)?(\\?[a-zA-Z0-9._~%!$&'()*+,;=:@/?-]*)?$";
27
- // Annotate the CommonJS export names for ESM import in node:
28
- 0 && (module.exports = {
29
- URI
30
- });
@@ -1,5 +0,0 @@
1
- // src/patterns/URI.pattern.ts
2
- var URI = "^([a-zA-Z][a-zA-Z0-9+\\-.]*:\\/\\/)([a-zA-Z0-9._%+-]+(:[a-zA-Z0-9._%+-]+)?@)?([a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,}(:\\d+)?(\\/[a-zA-Z0-9._-~%!$&'()*+,;=:@/]*)?(\\?[a-zA-Z0-9._~%!$&'()*+,;=:@/?-]*)?$";
3
- export {
4
- URI
5
- };
@@ -1,3 +0,0 @@
1
- declare const Username = "^(?=.*[a-zA-Z])[a-zA-Z0-9][a-zA-Z0-9_]*$";
2
-
3
- export { Username };
@@ -1,3 +0,0 @@
1
- declare const Username = "^(?=.*[a-zA-Z])[a-zA-Z0-9][a-zA-Z0-9_]*$";
2
-
3
- export { Username };
@@ -1,30 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/patterns/Username.pattern.ts
21
- var Username_pattern_exports = {};
22
- __export(Username_pattern_exports, {
23
- Username: () => Username
24
- });
25
- module.exports = __toCommonJS(Username_pattern_exports);
26
- var Username = "^(?=.*[a-zA-Z])[a-zA-Z0-9][a-zA-Z0-9_]*$";
27
- // Annotate the CommonJS export names for ESM import in node:
28
- 0 && (module.exports = {
29
- Username
30
- });
@@ -1,5 +0,0 @@
1
- // src/patterns/Username.pattern.ts
2
- var Username = "^(?=.*[a-zA-Z])[a-zA-Z0-9][a-zA-Z0-9_]*$";
3
- export {
4
- Username
5
- };
@@ -1,5 +0,0 @@
1
- import { AnyObject as AnyObject$1 } from 'yup';
2
-
3
- type AnyObject = AnyObject$1;
4
-
5
- export type { AnyObject };
@@ -1,5 +0,0 @@
1
- import { AnyObject as AnyObject$1 } from 'yup';
2
-
3
- type AnyObject = AnyObject$1;
4
-
5
- export type { AnyObject };
@@ -1,18 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __copyProps = (to, from, except, desc) => {
7
- if (from && typeof from === "object" || typeof from === "function") {
8
- for (let key of __getOwnPropNames(from))
9
- if (!__hasOwnProp.call(to, key) && key !== except)
10
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
- }
12
- return to;
13
- };
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
-
16
- // src/types/AnyObject.type.ts
17
- var AnyObject_type_exports = {};
18
- module.exports = __toCommonJS(AnyObject_type_exports);
File without changes
@@ -1,5 +0,0 @@
1
- import { TObject } from '@sinclair/typebox';
2
-
3
- type JSONSchema = TObject;
4
-
5
- export type { JSONSchema };
@@ -1,5 +0,0 @@
1
- import { TObject } from '@sinclair/typebox';
2
-
3
- type JSONSchema = TObject;
4
-
5
- export type { JSONSchema };
@@ -1,18 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __copyProps = (to, from, except, desc) => {
7
- if (from && typeof from === "object" || typeof from === "function") {
8
- for (let key of __getOwnPropNames(from))
9
- if (!__hasOwnProp.call(to, key) && key !== except)
10
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
- }
12
- return to;
13
- };
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
-
16
- // src/types/JSONSchema.type.ts
17
- var JSONSchema_type_exports = {};
18
- module.exports = __toCommonJS(JSONSchema_type_exports);
File without changes
@@ -1,45 +0,0 @@
1
- type Base = {
2
- pattern?: string;
3
- default?: unknown;
4
- nullable: boolean;
5
- required: boolean;
6
- };
7
- type String = Base & {
8
- type: 'string';
9
- enum?: string[];
10
- min?: number;
11
- max?: number;
12
- lowercase?: boolean;
13
- uppercase?: boolean;
14
- };
15
- type Number = Base & {
16
- type: 'number';
17
- enum?: number[];
18
- min?: number;
19
- max?: number;
20
- integer?: boolean;
21
- positive?: boolean;
22
- negative?: boolean;
23
- };
24
- type Boolean = Base & {
25
- type: 'boolean';
26
- };
27
- type Date = Base & {
28
- type: 'date';
29
- min?: string;
30
- max?: string;
31
- };
32
- type Object$1 = Base & {
33
- type: 'object';
34
- properties: Schema;
35
- };
36
- type Array = Base & {
37
- type: 'array';
38
- min?: number;
39
- max?: number;
40
- items: Types;
41
- };
42
- type Types = String | Number | Boolean | Date | Object$1 | Array;
43
- type Schema = Record<string, Types>;
44
-
45
- export type { Array, Base, Boolean, Date, Number, Object$1 as Object, Schema, String, Types };
@@ -1,45 +0,0 @@
1
- type Base = {
2
- pattern?: string;
3
- default?: unknown;
4
- nullable: boolean;
5
- required: boolean;
6
- };
7
- type String = Base & {
8
- type: 'string';
9
- enum?: string[];
10
- min?: number;
11
- max?: number;
12
- lowercase?: boolean;
13
- uppercase?: boolean;
14
- };
15
- type Number = Base & {
16
- type: 'number';
17
- enum?: number[];
18
- min?: number;
19
- max?: number;
20
- integer?: boolean;
21
- positive?: boolean;
22
- negative?: boolean;
23
- };
24
- type Boolean = Base & {
25
- type: 'boolean';
26
- };
27
- type Date = Base & {
28
- type: 'date';
29
- min?: string;
30
- max?: string;
31
- };
32
- type Object$1 = Base & {
33
- type: 'object';
34
- properties: Schema;
35
- };
36
- type Array = Base & {
37
- type: 'array';
38
- min?: number;
39
- max?: number;
40
- items: Types;
41
- };
42
- type Types = String | Number | Boolean | Date | Object$1 | Array;
43
- type Schema = Record<string, Types>;
44
-
45
- export type { Array, Base, Boolean, Date, Number, Object$1 as Object, Schema, String, Types };
@@ -1,18 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __copyProps = (to, from, except, desc) => {
7
- if (from && typeof from === "object" || typeof from === "function") {
8
- for (let key of __getOwnPropNames(from))
9
- if (!__hasOwnProp.call(to, key) && key !== except)
10
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
- }
12
- return to;
13
- };
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
-
16
- // src/types/Schema.type.ts
17
- var Schema_type_exports = {};
18
- module.exports = __toCommonJS(Schema_type_exports);
File without changes
@@ -1,5 +0,0 @@
1
- import { ValidateOptions as ValidateOptions$1 } from 'yup';
2
-
3
- type ValidateOptions = ValidateOptions$1;
4
-
5
- export type { ValidateOptions };
@@ -1,5 +0,0 @@
1
- import { ValidateOptions as ValidateOptions$1 } from 'yup';
2
-
3
- type ValidateOptions = ValidateOptions$1;
4
-
5
- export type { ValidateOptions };
@@ -1,18 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __copyProps = (to, from, except, desc) => {
7
- if (from && typeof from === "object" || typeof from === "function") {
8
- for (let key of __getOwnPropNames(from))
9
- if (!__hasOwnProp.call(to, key) && key !== except)
10
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
- }
12
- return to;
13
- };
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
-
16
- // src/types/ValidateOptions.type.ts
17
- var ValidateOptions_type_exports = {};
18
- module.exports = __toCommonJS(ValidateOptions_type_exports);
File without changes
@@ -1,5 +0,0 @@
1
- import { ValidationError as ValidationError$1 } from 'yup';
2
-
3
- type ValidationError = ValidationError$1;
4
-
5
- export type { ValidationError };
@@ -1,5 +0,0 @@
1
- import { ValidationError as ValidationError$1 } from 'yup';
2
-
3
- type ValidationError = ValidationError$1;
4
-
5
- export type { ValidationError };
@@ -1,18 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __copyProps = (to, from, except, desc) => {
7
- if (from && typeof from === "object" || typeof from === "function") {
8
- for (let key of __getOwnPropNames(from))
9
- if (!__hasOwnProp.call(to, key) && key !== except)
10
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
- }
12
- return to;
13
- };
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
-
16
- // src/types/ValidationError.type.ts
17
- var ValidationError_type_exports = {};
18
- module.exports = __toCommonJS(ValidationError_type_exports);
File without changes
@@ -1,46 +0,0 @@
1
- import { ValidateOptions } from './ValidateOptions.type.mjs';
2
- import 'yup';
3
-
4
- type YuppiOptions = {
5
- error_messages?: {
6
- base?: {
7
- pattern?: string;
8
- nullable?: string;
9
- required?: string;
10
- };
11
- string?: {
12
- type?: string;
13
- enum?: string;
14
- min?: string;
15
- max?: string;
16
- };
17
- number?: {
18
- type?: string;
19
- enum?: string;
20
- min?: string;
21
- max?: string;
22
- integer?: string;
23
- positive?: string;
24
- negative?: string;
25
- };
26
- boolean?: {
27
- type?: string;
28
- };
29
- date?: {
30
- type?: string;
31
- min?: string;
32
- max?: string;
33
- };
34
- object?: {
35
- type?: string;
36
- };
37
- array?: {
38
- type?: string;
39
- min?: string;
40
- max?: string;
41
- };
42
- };
43
- validate_options?: ValidateOptions;
44
- };
45
-
46
- export type { YuppiOptions };
@@ -1,46 +0,0 @@
1
- import { ValidateOptions } from './ValidateOptions.type.js';
2
- import 'yup';
3
-
4
- type YuppiOptions = {
5
- error_messages?: {
6
- base?: {
7
- pattern?: string;
8
- nullable?: string;
9
- required?: string;
10
- };
11
- string?: {
12
- type?: string;
13
- enum?: string;
14
- min?: string;
15
- max?: string;
16
- };
17
- number?: {
18
- type?: string;
19
- enum?: string;
20
- min?: string;
21
- max?: string;
22
- integer?: string;
23
- positive?: string;
24
- negative?: string;
25
- };
26
- boolean?: {
27
- type?: string;
28
- };
29
- date?: {
30
- type?: string;
31
- min?: string;
32
- max?: string;
33
- };
34
- object?: {
35
- type?: string;
36
- };
37
- array?: {
38
- type?: string;
39
- min?: string;
40
- max?: string;
41
- };
42
- };
43
- validate_options?: ValidateOptions;
44
- };
45
-
46
- export type { YuppiOptions };
@@ -1,18 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __copyProps = (to, from, except, desc) => {
7
- if (from && typeof from === "object" || typeof from === "function") {
8
- for (let key of __getOwnPropNames(from))
9
- if (!__hasOwnProp.call(to, key) && key !== except)
10
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
- }
12
- return to;
13
- };
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
-
16
- // src/types/YuppiOptions.type.ts
17
- var YuppiOptions_type_exports = {};
18
- module.exports = __toCommonJS(YuppiOptions_type_exports);
File without changes
@@ -1,7 +0,0 @@
1
- import * as yup from 'yup';
2
- import { TObject } from '@sinclair/typebox';
3
- import { Schema } from '../types/Schema.type.mjs';
4
-
5
- declare const convertToJSONSchema: (schema: Schema) => TObject<yup.AnyObject>;
6
-
7
- export { convertToJSONSchema };
@@ -1,7 +0,0 @@
1
- import * as yup from 'yup';
2
- import { TObject } from '@sinclair/typebox';
3
- import { Schema } from '../types/Schema.type.js';
4
-
5
- declare const convertToJSONSchema: (schema: Schema) => TObject<yup.AnyObject>;
6
-
7
- export { convertToJSONSchema };
@@ -1,69 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/utils/ConvertToJSONSchema.util.ts
21
- var ConvertToJSONSchema_util_exports = {};
22
- __export(ConvertToJSONSchema_util_exports, {
23
- convertToJSONSchema: () => convertToJSONSchema
24
- });
25
- module.exports = __toCommonJS(ConvertToJSONSchema_util_exports);
26
- var import_typebox = require("@sinclair/typebox");
27
-
28
- // src/patterns/Any.pattern.ts
29
- var Any = "[\\s\\S]*";
30
-
31
- // src/utils/ConvertToJSONSchema.util.ts
32
- var convertToJSONSchema = (schema) => {
33
- const build = (key, config) => {
34
- if (config.type === "string") {
35
- let schema2 = import_typebox.Type.String({ enum: config.enum, minLength: config.min, maxLength: config.max, pattern: new RegExp(config.pattern ?? Any).source, default: config.default });
36
- if (config.nullable) schema2 = import_typebox.Type.Union([schema2, import_typebox.Type.Null()]);
37
- return config.required ? schema2 : import_typebox.Type.Optional(schema2);
38
- } else if (config.type === "number") {
39
- let schema2 = config.integer === true ? import_typebox.Type.Integer({ enum: config.enum, minimum: config.min, maximum: config.max, default: config.default }) : import_typebox.Type.Number({ enum: config.enum, minimum: config.min, maximum: config.max, default: config.default });
40
- if (config.nullable) schema2 = import_typebox.Type.Union([schema2, import_typebox.Type.Null()]);
41
- return config.required ? schema2 : import_typebox.Type.Optional(schema2);
42
- } else if (config.type === "boolean") {
43
- let schema2 = import_typebox.Type.Boolean({ default: config.default });
44
- if (config.nullable) schema2 = import_typebox.Type.Union([schema2, import_typebox.Type.Null()]);
45
- return config.required ? schema2 : import_typebox.Type.Optional(schema2);
46
- } else if (config.type === "date") {
47
- let schema2 = import_typebox.Type.String({ format: "date-time", minimum: config.min, maximum: config.max, pattern: new RegExp(config.pattern ?? Any).source, default: config.default });
48
- if (config.nullable) schema2 = import_typebox.Type.Union([schema2, import_typebox.Type.Null()]);
49
- return config.required ? schema2 : import_typebox.Type.Optional(schema2);
50
- } else if (config.type === "object") {
51
- const nested_properties = {};
52
- for (const [nested_key, nested_config] of Object.entries(config.properties)) nested_properties[nested_key] = build(nested_key, nested_config);
53
- let schema2 = import_typebox.Type.Object(nested_properties);
54
- if (config.nullable) schema2 = import_typebox.Type.Union([schema2, import_typebox.Type.Null()]);
55
- return config.required ? schema2 : import_typebox.Type.Optional(schema2);
56
- } else if (config.type === "array") {
57
- let schema2 = import_typebox.Type.Array(build(key, config.items), { minItems: config.min, maxItems: config.max, default: config.default });
58
- if (config.nullable) schema2 = import_typebox.Type.Union([schema2, import_typebox.Type.Null()]);
59
- return config.required ? schema2 : import_typebox.Type.Optional(schema2);
60
- } else throw new Error(`Unsupported schema type for ${key}`);
61
- };
62
- const properties = {};
63
- for (const [key, config] of Object.entries(schema)) properties[key] = build(key, config);
64
- return import_typebox.Type.Object(properties);
65
- };
66
- // Annotate the CommonJS export names for ESM import in node:
67
- 0 && (module.exports = {
68
- convertToJSONSchema
69
- });