@imolko/ultra-v8n 2.0.1 → 2.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.
- package/dist-browser/errors/builtin.errors.spec.d.ts +2 -0
- package/dist-browser/errors/builtin.errors.spec.d.ts.map +1 -0
- package/dist-browser/errors/builtin.errors.spec.js +11 -0
- package/dist-browser/errors/builtin.errors.spec.js.map +1 -0
- package/dist-browser/errors/v8n-parse.error.spec.d.ts +2 -0
- package/dist-browser/errors/v8n-parse.error.spec.d.ts.map +1 -0
- package/dist-browser/errors/v8n-parse.error.spec.js +14 -0
- package/dist-browser/errors/v8n-parse.error.spec.js.map +1 -0
- package/dist-browser/utils/convert-zod-issue-to-v8n-error.spec.d.ts +2 -0
- package/dist-browser/utils/convert-zod-issue-to-v8n-error.spec.d.ts.map +1 -0
- package/dist-browser/utils/convert-zod-issue-to-v8n-error.spec.js +55 -0
- package/dist-browser/utils/convert-zod-issue-to-v8n-error.spec.js.map +1 -0
- package/dist-browser/utils/is-object-json.spec.d.ts +2 -0
- package/dist-browser/utils/is-object-json.spec.d.ts.map +1 -0
- package/dist-browser/utils/is-object-json.spec.js +34 -0
- package/dist-browser/utils/is-object-json.spec.js.map +1 -0
- package/dist-browser/utils/message-template.spec.d.ts +2 -0
- package/dist-browser/utils/message-template.spec.d.ts.map +1 -0
- package/dist-browser/utils/message-template.spec.js +80 -0
- package/dist-browser/utils/message-template.spec.js.map +1 -0
- package/dist-browser/utils/zod-switch-example/zod-switch.spec.d.ts +2 -0
- package/dist-browser/utils/zod-switch-example/zod-switch.spec.d.ts.map +1 -0
- package/dist-browser/utils/zod-switch-example/zod-switch.spec.js +43 -0
- package/dist-browser/utils/zod-switch-example/zod-switch.spec.js.map +1 -0
- package/dist-browser/validate-zod-schema.spec.d.ts +2 -0
- package/dist-browser/validate-zod-schema.spec.d.ts.map +1 -0
- package/dist-browser/validate-zod-schema.spec.js +55 -0
- package/dist-browser/validate-zod-schema.spec.js.map +1 -0
- package/package.json +9 -9
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"builtin.errors.spec.d.ts","sourceRoot":"","sources":["../../src/errors/builtin.errors.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { V8nBuiltInErrorCode } from './builtin-codes';
|
|
2
|
+
import { getInternalErrorFromCode } from './parse-error.decorator';
|
|
3
|
+
import { InvalidTypeError } from './builtin.errors';
|
|
4
|
+
describe('V8nParseError', () => {
|
|
5
|
+
describe('invalid_type is registarin', () => {
|
|
6
|
+
it('class InvalidTypeError deberia estar registrada por defecto para invalid_type', () => {
|
|
7
|
+
expect(getInternalErrorFromCode(V8nBuiltInErrorCode.invalid_type)).toBe(InvalidTypeError);
|
|
8
|
+
});
|
|
9
|
+
});
|
|
10
|
+
});
|
|
11
|
+
//# sourceMappingURL=builtin.errors.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"builtin.errors.spec.js","sourceRoot":"","sources":["../../src/errors/builtin.errors.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,QAAQ,CAAC,4BAA4B,EAAE,GAAG,EAAE;QAC1C,EAAE,CAAE,+EAA+E,EAAE,GAAG,EAAE;YACxF,MAAM,CAAC,wBAAwB,CAAC,mBAAmB,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;QAC5F,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v8n-parse.error.spec.d.ts","sourceRoot":"","sources":["../../src/errors/v8n-parse.error.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { V8nParseErrorClassFactory } from './v8n-parser-error-class-factory';
|
|
2
|
+
describe('v8n', () => {
|
|
3
|
+
it('V8nParseError().zod should be function', () => {
|
|
4
|
+
class A extends V8nParseErrorClassFactory('invalid_type', 'Invalid Type') {
|
|
5
|
+
}
|
|
6
|
+
expect(typeof A.v8n).toBe('function');
|
|
7
|
+
});
|
|
8
|
+
it('V8nParseError().zod should be function', () => {
|
|
9
|
+
class B extends V8nParseErrorClassFactory('custom_prueba', 'Custom Prueba', 'Custom Prueba') {
|
|
10
|
+
}
|
|
11
|
+
expect(typeof B.v8n).toBe('function');
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
//# sourceMappingURL=v8n-parse.error.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v8n-parse.error.spec.js","sourceRoot":"","sources":["../../src/errors/v8n-parse.error.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAE7E,QAAQ,CAAC,KAAK,EAAE,GAAG,EAAE;IACnB,EAAE,CAAC,wCAAwC,EAAE,GAAG,EAAE;QAChD,MAAM,CAAE,SAAQ,yBAAyB,CAAC,cAAc,EAAE,cAAc,CAAC;SACxE;QACD,MAAM,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACxC,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,wCAAwC,EAAE,GAAG,EAAE;QAChD,MAAM,CAAE,SAAQ,yBAAyB,CAAC,eAAe,EAAE,eAAe,EAAE,eAAe,CAAC;SAC3F;QACD,MAAM,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACxC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convert-zod-issue-to-v8n-error.spec.d.ts","sourceRoot":"","sources":["../../src/utils/convert-zod-issue-to-v8n-error.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { convertZodIssueToV8nError } from './convert-zod-issue-to-v8n-error';
|
|
8
|
+
import { InvalidTypeError, V8nCustomParseError, V8nParseErrorClassFactory } from '../errors';
|
|
9
|
+
const code = 'custom_fake';
|
|
10
|
+
let CustomErrorFake = class CustomErrorFake extends V8nParseErrorClassFactory(code, 'Custom Error Fake', 'Custom Error de mentirita') {
|
|
11
|
+
};
|
|
12
|
+
CustomErrorFake = __decorate([
|
|
13
|
+
V8nCustomParseError(code)
|
|
14
|
+
], CustomErrorFake);
|
|
15
|
+
describe("convert-zod-issue-to-v8n-error", () => {
|
|
16
|
+
it("convertir issue built-in", () => {
|
|
17
|
+
const issue = {
|
|
18
|
+
code: 'invalid_type',
|
|
19
|
+
message: 'Invalid type',
|
|
20
|
+
path: [],
|
|
21
|
+
expected: 'string',
|
|
22
|
+
received: 'number'
|
|
23
|
+
};
|
|
24
|
+
const expectedError = {
|
|
25
|
+
type: 'http://journal/v8n/invalid_type',
|
|
26
|
+
title: 'Invalid Type',
|
|
27
|
+
detail: 'Invalid type',
|
|
28
|
+
path: [],
|
|
29
|
+
extended: { code: 'invalid_type', expected: 'string', received: 'number' },
|
|
30
|
+
stack: expect.anything()
|
|
31
|
+
};
|
|
32
|
+
const result = convertZodIssueToV8nError(issue);
|
|
33
|
+
expect(result).toBeInstanceOf(InvalidTypeError);
|
|
34
|
+
expect(result).toEqual(expectedError);
|
|
35
|
+
});
|
|
36
|
+
it("convertir issue custom con v8n()", () => {
|
|
37
|
+
const issue = {
|
|
38
|
+
code: 'custom',
|
|
39
|
+
message: CustomErrorFake.v8n(),
|
|
40
|
+
path: []
|
|
41
|
+
};
|
|
42
|
+
const expectedError = {
|
|
43
|
+
type: 'http://journal/v8n/custom_fake',
|
|
44
|
+
title: 'Custom Error Fake',
|
|
45
|
+
detail: 'Custom Error de mentirita',
|
|
46
|
+
path: [],
|
|
47
|
+
extended: { code: 'custom_fake' },
|
|
48
|
+
stack: expect.anything()
|
|
49
|
+
};
|
|
50
|
+
const result = convertZodIssueToV8nError(issue);
|
|
51
|
+
expect(result).toBeInstanceOf(CustomErrorFake);
|
|
52
|
+
expect(result).toEqual(expectedError);
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
//# sourceMappingURL=convert-zod-issue-to-v8n-error.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convert-zod-issue-to-v8n-error.spec.js","sourceRoot":"","sources":["../../src/utils/convert-zod-issue-to-v8n-error.spec.ts"],"names":[],"mappings":";;;;;;AACA,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AAE7F,MAAM,IAAI,GAAG,aAAa,CAAC;AAG3B,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,yBAAyB,CAAC,IAAI,EAAE,mBAAmB,EAAE,2BAA2B,CAAC;CAC9G,CAAA;AADK,eAAe;IADpB,mBAAmB,CAAC,IAAI,CAAC;GACpB,eAAe,CACpB;AAED,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,CAAC,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC;QAC/C,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IACxC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-object-json.spec.d.ts","sourceRoot":"","sources":["../../src/utils/is-object-json.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { isObjectJSON } from './is-object-json';
|
|
2
|
+
describe('is-object-json', () => {
|
|
3
|
+
it('validar un string simple', () => {
|
|
4
|
+
const value = "'churro'";
|
|
5
|
+
const result = isObjectJSON(value);
|
|
6
|
+
expect(result).toBe(false);
|
|
7
|
+
});
|
|
8
|
+
it('validar un número', () => {
|
|
9
|
+
const value = "15";
|
|
10
|
+
const result = isObjectJSON(value);
|
|
11
|
+
expect(result).toBe(false);
|
|
12
|
+
});
|
|
13
|
+
it('validar un arreglo', () => {
|
|
14
|
+
const value = "[1,2,3,4]";
|
|
15
|
+
const result = isObjectJSON(value);
|
|
16
|
+
expect(result).toBe(false);
|
|
17
|
+
});
|
|
18
|
+
it('validar null', () => {
|
|
19
|
+
const value = "null";
|
|
20
|
+
const result = isObjectJSON(value);
|
|
21
|
+
expect(result).toBe(false);
|
|
22
|
+
});
|
|
23
|
+
it('validar un string vacío', () => {
|
|
24
|
+
const value = "";
|
|
25
|
+
const result = isObjectJSON(value);
|
|
26
|
+
expect(result).toBe(false);
|
|
27
|
+
});
|
|
28
|
+
it('validar un mapa', () => {
|
|
29
|
+
const value = '{"name":"pedrito"}';
|
|
30
|
+
const result = isObjectJSON(value);
|
|
31
|
+
expect(result).toBe(true);
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
//# sourceMappingURL=is-object-json.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-object-json.spec.js","sourceRoot":"","sources":["../../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AC;IAC7B,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,iBAAiB,EAAE,GAAG,EAAE;QACzB,MAAM,KAAK,GAAG,oBAAoB,CAAC;QACnC,MAAM,MAAM,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;QACnC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message-template.spec.d.ts","sourceRoot":"","sources":["../../src/utils/message-template.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { V8nMessageTemplate } from './message-template';
|
|
2
|
+
describe('V8nMessageTemplate', () => {
|
|
3
|
+
describe('interpolate', () => {
|
|
4
|
+
it('debería interpolar correctamente los valores', () => {
|
|
5
|
+
const result = V8nMessageTemplate.interpolate('${abc}', { abc: 'xyz' });
|
|
6
|
+
expect(result).toBe('xyz');
|
|
7
|
+
});
|
|
8
|
+
it('debería dejar el valor original si no se encuentra un valor para una llave', () => {
|
|
9
|
+
const result = V8nMessageTemplate.interpolate('${abc}', { def: 'xyz' });
|
|
10
|
+
expect(result).toBe('${abc}');
|
|
11
|
+
});
|
|
12
|
+
it('debería manejar correctamente el escape del signo $', () => {
|
|
13
|
+
const result = V8nMessageTemplate.interpolate('$$${abc}', { abc: 'xyz' });
|
|
14
|
+
expect(result).toBe('$xyz');
|
|
15
|
+
});
|
|
16
|
+
it('debería manejar múltiples interpolaciones en un string', () => {
|
|
17
|
+
const result = V8nMessageTemplate.interpolate('${abc} ${def}', { abc: 'xyz', def: 'uvw' });
|
|
18
|
+
expect(result).toBe('xyz uvw');
|
|
19
|
+
});
|
|
20
|
+
it('debería manejar un string que comienza con una interpolación', () => {
|
|
21
|
+
const result = V8nMessageTemplate.interpolate('${abc}def', { abc: 'xyz' });
|
|
22
|
+
expect(result).toBe('xyzdef');
|
|
23
|
+
});
|
|
24
|
+
it('debería manejar un string que termina con una interpolación', () => {
|
|
25
|
+
const result = V8nMessageTemplate.interpolate('abc${def}', { def: 'uvw' });
|
|
26
|
+
expect(result).toBe('abcuvw');
|
|
27
|
+
});
|
|
28
|
+
it('debería manejar un string que comienza con un escape', () => {
|
|
29
|
+
const result = V8nMessageTemplate.interpolate('$$abc', {});
|
|
30
|
+
expect(result).toBe('$$abc');
|
|
31
|
+
});
|
|
32
|
+
it('debería manejar un string que termina con un escape', () => {
|
|
33
|
+
const result = V8nMessageTemplate.interpolate('abc$$', {});
|
|
34
|
+
expect(result).toBe('abc$$');
|
|
35
|
+
});
|
|
36
|
+
it('debería manejar un string que comienza con dos escapes', () => {
|
|
37
|
+
const result = V8nMessageTemplate.interpolate('$$$abc', {});
|
|
38
|
+
expect(result).toBe('$$$abc');
|
|
39
|
+
});
|
|
40
|
+
it('debería manejar un string que termina con dos escapes', () => {
|
|
41
|
+
const result = V8nMessageTemplate.interpolate('abc$$$', {});
|
|
42
|
+
expect(result).toBe('abc$$$');
|
|
43
|
+
});
|
|
44
|
+
it('deberia manejar numeros como valores', () => {
|
|
45
|
+
const result = V8nMessageTemplate.interpolate('${abc}', { abc: 123 });
|
|
46
|
+
expect(result).toBe('123');
|
|
47
|
+
});
|
|
48
|
+
it('deberia manejar booleanos como valores', () => {
|
|
49
|
+
const result = V8nMessageTemplate.interpolate('${abc}', { abc: true });
|
|
50
|
+
expect(result).toBe('true');
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
describe('hasVariable', () => {
|
|
54
|
+
it('debería devolver verdadero si el string incluye información de template', () => {
|
|
55
|
+
const result = V8nMessageTemplate.hasVariable('${abc}');
|
|
56
|
+
expect(result).toBe(true);
|
|
57
|
+
});
|
|
58
|
+
it('debería devolver falso si el string no incluye información de template', () => {
|
|
59
|
+
const result = V8nMessageTemplate.hasVariable('abc');
|
|
60
|
+
expect(result).toBe(false);
|
|
61
|
+
});
|
|
62
|
+
it('debería devolver verdadero si el string incluye múltiples informaciones de template', () => {
|
|
63
|
+
const result = V8nMessageTemplate.hasVariable('${abc} ${def}');
|
|
64
|
+
expect(result).toBe(true);
|
|
65
|
+
});
|
|
66
|
+
it('debería devolver falso si el string incluye un signo $ pero no una información de template', () => {
|
|
67
|
+
const result = V8nMessageTemplate.hasVariable('abc$def');
|
|
68
|
+
expect(result).toBe(false);
|
|
69
|
+
});
|
|
70
|
+
it('debería devolver verdadero si el string incluye una información de template con espacios', () => {
|
|
71
|
+
const result = V8nMessageTemplate.hasVariable('${ abc }');
|
|
72
|
+
expect(result).toBe(true);
|
|
73
|
+
});
|
|
74
|
+
it('debería devolver falso si el string incluye un signo $ seguido de un espacio pero no una información de template', () => {
|
|
75
|
+
const result = V8nMessageTemplate.hasVariable('abc$ def');
|
|
76
|
+
expect(result).toBe(false);
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
//# sourceMappingURL=message-template.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message-template.spec.js","sourceRoot":"","sources":["../../src/utils/message-template.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExD,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAClC,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;QAC3B,EAAE,CAAC,8CAA8C,EAAE,GAAG,EAAE;YACtD,MAAM,MAAM,GAAG,kBAAkB,CAAC,WAAW,CAAC,QAAQ,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,CAAC;YACxE,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC7B,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,4EAA4E,EAAE,GAAG,EAAE;YACpF,MAAM,MAAM,GAAG,kBAAkB,CAAC,WAAW,CAAC,QAAQ,EAAE,EAAE,GAAG,EAAE,KAAK,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,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC7B,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zod-switch.spec.d.ts","sourceRoot":"","sources":["../../../src/utils/zod-switch-example/zod-switch.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { SwitchConditions, StrategyEnum } from './conditions';
|
|
2
|
+
describe('ZodSwitch', () => {
|
|
3
|
+
it('validar exitosamente la estrategia AtLeast', () => {
|
|
4
|
+
const input = { type: StrategyEnum.AtLeast, min: 5 };
|
|
5
|
+
const result = SwitchConditions.safeParse(input);
|
|
6
|
+
expect(result.success).toBe(true);
|
|
7
|
+
if (result.success) {
|
|
8
|
+
expect(result.data.strategy).toEqual(input);
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
it('validar exitosamente la estrategia Timely', () => {
|
|
12
|
+
const input = {
|
|
13
|
+
type: StrategyEnum.Timely,
|
|
14
|
+
maxDuration: '10m',
|
|
15
|
+
min: 2
|
|
16
|
+
};
|
|
17
|
+
const result = SwitchConditions.safeParse(input);
|
|
18
|
+
expect(result.success).toBe(true);
|
|
19
|
+
if (result.success) {
|
|
20
|
+
expect(result.data.strategy).toEqual(input);
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
it('Falla si faltan campos requeridos por la estrategia seleccionada', () => {
|
|
24
|
+
const input = { type: StrategyEnum.AtLeast };
|
|
25
|
+
const result = SwitchConditions.safeParse(input);
|
|
26
|
+
expect(result.success).toBe(false);
|
|
27
|
+
});
|
|
28
|
+
it('Falla si el tipo no existe en el discriminador', () => {
|
|
29
|
+
const input = { type: 'InvalidType' };
|
|
30
|
+
const result = SwitchConditions.safeParse(input);
|
|
31
|
+
expect(result.success).toBe(false);
|
|
32
|
+
});
|
|
33
|
+
it('Falla si falla la regla DurationTimeRules en Timely', () => {
|
|
34
|
+
const input = {
|
|
35
|
+
type: StrategyEnum.Timely,
|
|
36
|
+
maxDuration: 'a',
|
|
37
|
+
min: 2
|
|
38
|
+
};
|
|
39
|
+
const result = SwitchConditions.safeParse(input);
|
|
40
|
+
expect(result.success).toBe(false);
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
//# sourceMappingURL=zod-switch.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zod-switch.spec.js","sourceRoot":"","sources":["../../../src/utils/zod-switch-example/zod-switch.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE9D,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;IACzB,EAAE,CAAC,4CAA4C,EAAE,GAAG,EAAE;QACpD,MAAM,KAAK,GAAG,EAAE,IAAI,EAAE,YAAY,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;QACrD,MAAM,MAAM,GAAG,gBAAgB,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QACjD,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAClC,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;YACnB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAC9C,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,2CAA2C,EAAE,GAAG,EAAE;QACnD,MAAM,KAAK,GAAG;YACZ,IAAI,EAAE,YAAY,CAAC,MAAM;YACzB,WAAW,EAAE,KAAK;YAClB,GAAG,EAAE,CAAC;SACP,CAAC;QACF,MAAM,MAAM,GAAG,gBAAgB,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QACjD,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CA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AAO,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import '@imolko/ultra-result/test';
|
|
8
|
+
import { z } from 'zod';
|
|
9
|
+
import { validateZodSchema } from './validate-zod-schema';
|
|
10
|
+
import { TooSmallError, V8nCustomParseError, V8nParseErrorClassFactory } from './errors';
|
|
11
|
+
const code = 'custom_fake';
|
|
12
|
+
let CustomErrorFake = class CustomErrorFake extends V8nParseErrorClassFactory(code, 'Custom Error Fake', 'Custom Error de mentirita') {
|
|
13
|
+
};
|
|
14
|
+
CustomErrorFake = __decorate([
|
|
15
|
+
V8nCustomParseError(code)
|
|
16
|
+
], CustomErrorFake);
|
|
17
|
+
describe("validate-zod-schema", () => {
|
|
18
|
+
it("parsear contenido con error built-in", () => {
|
|
19
|
+
const schema = z.string().min(3);
|
|
20
|
+
const content = 'pe';
|
|
21
|
+
const expectedError = {
|
|
22
|
+
"type": "http://journal/v8n/too_small",
|
|
23
|
+
"title": "Too Small",
|
|
24
|
+
"detail": "Too small: expected string to have >=3 characters",
|
|
25
|
+
"path": [],
|
|
26
|
+
"extended": {
|
|
27
|
+
"code": "too_small",
|
|
28
|
+
"origin": "string",
|
|
29
|
+
"minimum": 3,
|
|
30
|
+
"inclusive": true
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
const parsed = validateZodSchema(schema, content);
|
|
34
|
+
// console.log(JSON.stringify(parsed.getErrors(), null, 2))
|
|
35
|
+
expect(parsed).toBeInvalidWithError(TooSmallError);
|
|
36
|
+
expect(parsed).toHaveErrorLike(expectedError);
|
|
37
|
+
});
|
|
38
|
+
it("parsear contenido con error custom", () => {
|
|
39
|
+
const schema = z.string().refine(value => false, CustomErrorFake.v8n());
|
|
40
|
+
const content = 'invalid value';
|
|
41
|
+
const expectedError = {
|
|
42
|
+
type: 'http://journal/v8n/custom_fake',
|
|
43
|
+
title: 'Custom Error Fake',
|
|
44
|
+
detail: 'Custom Error de mentirita',
|
|
45
|
+
path: [],
|
|
46
|
+
extended: {
|
|
47
|
+
code: 'custom_fake'
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
const parsed = validateZodSchema(schema, content);
|
|
51
|
+
expect(parsed).toBeInvalidWithError(CustomErrorFake);
|
|
52
|
+
expect(parsed).toHaveErrorLike(expectedError);
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
//# sourceMappingURL=validate-zod-schema.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-zod-schema.spec.js","sourceRoot":"","sources":["../src/validate-zod-schema.spec.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,2BAA2B,CAAC;AAEnC,OAAO,EAAW,CAAC,EAAE,MAAM,KAAK,CAAA;AAChC,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAGzF,MAAM,IAAI,GAAG,aAAa,CAAC;AAK3B,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,yBAAyB,CAAC,IAAI,EAAE,mBAAmB,EAAE,2BAA2B,CAAC;CAC9G,CAAA;AADK,eAAe;IADpB,mBAAmB,CAAC,IAAI,CAAC;GACpB,eAAe,CACpB;AAGD,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;IACnC,EAAE,CAA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CAAC,eAAe,CAAC,aAAa,CAAC,CAAC;IAChD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@imolko/ultra-v8n",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Librería para el manejo de errores y validaciones que extiende el funcionamiento de zod",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"results",
|
|
@@ -36,21 +36,21 @@
|
|
|
36
36
|
"scripts": {
|
|
37
37
|
"clean": "rm -rf dist-browser dist-node",
|
|
38
38
|
"build-browser": "tsc -p tsconfig.browser.json",
|
|
39
|
-
"build-node": "tsc -p tsconfig.json",
|
|
39
|
+
"build-node": "tsc -p tsconfig.node.json",
|
|
40
40
|
"build": "npm run clean && npm run build-node && npm run build-browser",
|
|
41
41
|
"test": "jest"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@types/jest": "^
|
|
45
|
-
"jest": "^
|
|
46
|
-
"ts-jest": "^29.4.
|
|
44
|
+
"@types/jest": "^30.0.0",
|
|
45
|
+
"jest": "^30.3.0",
|
|
46
|
+
"ts-jest": "^29.4.9",
|
|
47
47
|
"tslib": "^2.8.1",
|
|
48
|
-
"typescript": "^
|
|
48
|
+
"typescript": "^6.0.3"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@imolko/ultra-result": "^2.
|
|
52
|
-
"@imolko/ultra-tsconfig": "1.0
|
|
51
|
+
"@imolko/ultra-result": "^2.1.1",
|
|
52
|
+
"@imolko/ultra-tsconfig": "1.1.0",
|
|
53
53
|
"reflect-metadata": "^0.2.2",
|
|
54
|
-
"zod": "^4.
|
|
54
|
+
"zod": "^4.3.6"
|
|
55
55
|
}
|
|
56
56
|
}
|