Skip to content

Commit 8ede4e9

Browse files
committed
refactor: simplify StandardValidator constructor and remove unused options parameter
1 parent 55d3eaa commit 8ede4e9

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

lib/validators/standard.validator.ts

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,19 @@
11
import type { StandardSchemaV1 } from '@standard-schema/spec';
2-
3-
import { ValidationOptions } from '../interfaces/validation-schema.interface';
42
import { Validator } from './abstract.validator';
53

64
/**
75
* Standard Schema adapter
86
* @publicApi
97
*/
108
export class StandardValidator extends Validator {
11-
constructor(
12-
private schema: StandardSchemaV1<any, any>,
13-
private _options?: ValidationOptions,
14-
) {
9+
constructor(private schema: StandardSchemaV1<any, any>) {
1510
super();
1611
}
1712

18-
validate(
19-
config: StandardSchemaV1.Props<unknown, Record<string, any>>,
20-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
21-
_options?: ValidationOptions,
22-
): { error?: Error; value: Record<string, any> } {
13+
validate(config: StandardSchemaV1.Props<unknown, Record<string, any>>): {
14+
error?: Error;
15+
value: Record<string, any>;
16+
} {
2317
const result = this.schema['~standard'].validate(config);
2418
if (result instanceof Promise) {
2519
throw new Error('Expected sync result');

0 commit comments

Comments
 (0)