All files / validator/yupTypes object.ts

0% Statements 0/0
0% Branches 0/0
0% Functions 0/0
0% Lines 0/0

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23                                             
import { ObjectLocale } from './Locale'
import { GetObjectSchema, MixedSchema, SchemaValidateOptions } from './mixed'
 
export interface ObjectSchema<T extends {} = {}> extends MixedSchema<T> {
  shape(fields: GetObjectSchema<T>, noSortEdges?: Array<[string, string]>): this
 
  from(fromKey: keyof T, toKey: string, alias?: boolean): this
 
  noUnknown(onlyKnownKeys?: boolean, message?: ObjectLocale['noUnknown']): this
 
  camelCase(): this
 
  constantCase(): this
 
  validateInOrder(value: T, options?: SchemaValidateOptions): Promise<T>
 
  validateInOrderSync(value: T, options?: SchemaValidateOptions): T
}
 
export declare function object<T extends {} = {}>(
  fields?: GetObjectSchema<T> | ((schema: ObjectSchema<T>) => ObjectSchema<T>),
): ObjectSchema<T>