Skip to content

Interface: SchemaInternals ​

Properties ​

PropertyTypeDescription
$_superSchema_2Parent schema object.
$_termsRecord<string, any>Terms of current schema.

Methods ​

$_addRule() ​

ts
$_addRule(rule: string | AddRuleOptions): Schema_2;

Adds a rule to current validation schema.

Parameters ​

ParameterType
rulestring | AddRuleOptions

Returns ​

Schema_2


$_compile() ​

ts
$_compile(schema: SchemaLike_2, options?: CompileOptions): Schema_2;

Internally compiles schema.

Parameters ​

ParameterType
schemaSchemaLike_2
options?CompileOptions

Returns ​

Schema_2


$_createError() ​

ts
$_createError(
   code: string,
   value: any,
   context: ValidationContext,
   state: State,
   prefs: ValidationOptions,
   options?: CreateErrorOptions): Err;

Creates a joi error object.

Parameters ​

ParameterType
codestring
valueany
contextValidationContext
stateState
prefsValidationOptions
options?CreateErrorOptions

Returns ​

Err


$_getFlag() ​

ts
$_getFlag(name: string): any;

Get value from given flag.

Parameters ​

ParameterType
namestring

Returns ​

any


$_getRule() ​

ts
$_getRule(name: string): GetRuleOptions | undefined;

Retrieve some rule configuration.

Parameters ​

ParameterType
namestring

Returns ​

GetRuleOptions | undefined


$_mapLabels() ​

ts
$_mapLabels(path: string | string[]): string;

Parameters ​

ParameterType
pathstring | string[]

Returns ​

string


$_match() ​

ts
$_match(
   value: any,
   state: State,
   prefs: ValidationOptions): boolean;

Returns true if validations runs fine on given value.

Parameters ​

ParameterType
valueany
stateState
prefsValidationOptions

Returns ​

boolean


$_modify() ​

ts
$_modify(options?: ModifyOptions): Schema_2;

Parameters ​

ParameterType
options?ModifyOptions

Returns ​

Schema_2


$_mutateRebuild() ​

ts
$_mutateRebuild(): this;

Resets current schema.

Returns ​

this


$_mutateRegister() ​

ts
$_mutateRegister(schema: Schema_2, options?: MutateRegisterOptions): void;

Parameters ​

ParameterType
schemaSchema_2
options?MutateRegisterOptions

Returns ​

void


$_property() ​

ts
$_property(name: string): any;

Get value from given property.

Parameters ​

ParameterType
namestring

Returns ​

any


$_reach() ​

ts
$_reach(path: string[]): Schema_2;

Get schema at given path.

Parameters ​

ParameterType
pathstring[]

Returns ​

Schema_2


$_rootReferences() ​

ts
$_rootReferences(): any;

Get current schema root references.

Returns ​

any


$_setFlag() ​

ts
$_setFlag(
   flag: string,
   value: any,
   options?: SetFlagOptions): void;

Set flag to given value.

Parameters ​

ParameterType
flagstring
valueany
options?SetFlagOptions

Returns ​

void


$_validate() ​

ts
$_validate(
   value: any,
   state: State,
   prefs: ValidationOptions): ValidationResult;

Runs internal validations against given value.

Parameters ​

ParameterType
valueany
stateState
prefsValidationOptions

Returns ​

ValidationResult