@theshelf/validation 0.0.2 → 0.0.3
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/definitions/interfaces.d.ts +2 -2
- package/dist/definitions/types.d.ts +1 -1
- package/dist/errors/UnknownImplementation.d.ts +1 -1
- package/dist/errors/UnknownImplementation.js +1 -1
- package/dist/errors/UnknownValidator.d.ts +1 -1
- package/dist/errors/UnknownValidator.js +1 -1
- package/dist/implementation.d.ts +1 -1
- package/dist/implementation.js +2 -2
- package/dist/implementations/zod/Zod.d.ts +3 -3
- package/dist/implementations/zod/Zod.js +3 -3
- package/dist/implementations/zod/create.d.ts +1 -1
- package/dist/implementations/zod/create.js +1 -1
- package/dist/index.d.ts +6 -6
- package/dist/index.js +6 -6
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type ValidationResult from './ValidationResult';
|
|
2
|
-
import type { ValidationSchema } from './types';
|
|
1
|
+
import type ValidationResult from './ValidationResult.js';
|
|
2
|
+
import type { ValidationSchema } from './types.js';
|
|
3
3
|
export interface Validator {
|
|
4
4
|
validate(data: unknown, schema: ValidationSchema): ValidationResult;
|
|
5
5
|
}
|
package/dist/implementation.d.ts
CHANGED
package/dist/implementation.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import UnknownImplementation from './errors/UnknownImplementation';
|
|
2
|
-
import createZod from './implementations/zod/create';
|
|
1
|
+
import UnknownImplementation from './errors/UnknownImplementation.js';
|
|
2
|
+
import createZod from './implementations/zod/create.js';
|
|
3
3
|
const implementations = new Map([
|
|
4
4
|
['zod', createZod]
|
|
5
5
|
]);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import ValidationResult from '../../definitions/ValidationResult';
|
|
2
|
-
import type { Validator } from '../../definitions/interfaces';
|
|
3
|
-
import type { ValidationSchema } from '../../definitions/types';
|
|
1
|
+
import ValidationResult from '../../definitions/ValidationResult.js';
|
|
2
|
+
import type { Validator } from '../../definitions/interfaces.js';
|
|
3
|
+
import type { ValidationSchema } from '../../definitions/types.js';
|
|
4
4
|
export default class Zod implements Validator {
|
|
5
5
|
#private;
|
|
6
6
|
constructor();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import ValidationResult from '../../definitions/ValidationResult';
|
|
3
|
-
import { FieldTypes, MAX_EMAIL_LENGTH, MAX_URL_LENGTH } from '../../definitions/constants';
|
|
4
|
-
import UnknownValidator from '../../errors/UnknownValidator';
|
|
2
|
+
import ValidationResult from '../../definitions/ValidationResult.js';
|
|
3
|
+
import { FieldTypes, MAX_EMAIL_LENGTH, MAX_URL_LENGTH } from '../../definitions/constants.js';
|
|
4
|
+
import UnknownValidator from '../../errors/UnknownValidator.js';
|
|
5
5
|
// Zod is so type heavy that we've chosen for inferred types to be used.
|
|
6
6
|
// This is a trade-off between readability and verbosity.
|
|
7
7
|
export default class Zod {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import Zod from './Zod';
|
|
1
|
+
import Zod from './Zod.js';
|
|
2
2
|
export default function create(): Zod;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from './definitions/constants';
|
|
2
|
-
export * from './definitions/types';
|
|
3
|
-
export { default as UnknownImplementation } from './errors/UnknownImplementation';
|
|
4
|
-
export { default as UnknownValidator } from './errors/UnknownValidator';
|
|
5
|
-
export { default as ValidationError } from './errors/ValidationError';
|
|
6
|
-
export { default } from './implementation';
|
|
1
|
+
export * from './definitions/constants.js';
|
|
2
|
+
export * from './definitions/types.js';
|
|
3
|
+
export { default as UnknownImplementation } from './errors/UnknownImplementation.js';
|
|
4
|
+
export { default as UnknownValidator } from './errors/UnknownValidator.js';
|
|
5
|
+
export { default as ValidationError } from './errors/ValidationError.js';
|
|
6
|
+
export { default } from './implementation.js';
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from './definitions/constants';
|
|
2
|
-
export * from './definitions/types';
|
|
3
|
-
export { default as UnknownImplementation } from './errors/UnknownImplementation';
|
|
4
|
-
export { default as UnknownValidator } from './errors/UnknownValidator';
|
|
5
|
-
export { default as ValidationError } from './errors/ValidationError';
|
|
6
|
-
export { default } from './implementation';
|
|
1
|
+
export * from './definitions/constants.js';
|
|
2
|
+
export * from './definitions/types.js';
|
|
3
|
+
export { default as UnknownImplementation } from './errors/UnknownImplementation.js';
|
|
4
|
+
export { default as UnknownValidator } from './errors/UnknownValidator.js';
|
|
5
|
+
export { default as ValidationError } from './errors/ValidationError.js';
|
|
6
|
+
export { default } from './implementation.js';
|