-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
ObjectSchema.ts
21 lines (21 loc) · 1 KB
/
ObjectSchema.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import * as converter from "../appliers/converter.ts";
import * as ifUndefined from "../appliers/ifUndefined.ts";
import * as ifEmptyString from "../appliers/ifEmptyString.ts";
import * as ifNull from "../appliers/ifNull.ts";
import * as schema from "../appliers/object/schema.ts";
import * as type from "../appliers/object/type.ts";
import { AnyObject, ObjectTypeOf, SchemaObject } from "../libs/types.ts";
import { BaseSchema } from "./BaseSchema.ts";
export type OptionsForObject<S> = converter.Options<AnyObject> | ifUndefined.Options<AnyObject> | ifEmptyString.Options<AnyObject> | ifNull.Options<AnyObject> | schema.Options<S> | type.Options;
export class ObjectSchema<S extends SchemaObject, Tx = never> extends BaseSchema<ObjectTypeOf<S> | Tx> {
constructor(options: OptionsForObject<S>) {
super(options, [
ifUndefined.applyTo,
ifNull.applyTo,
ifEmptyString.applyTo,
schema.applyTo,
type.applyTo,
converter.applyTo,
]);
}
}