Interface: SchemaInternals
Properties
| Property | Type | Description |
|---|---|---|
$_super | Schema | Parent schema object. |
$_terms | Record<string, any> | Terms of current schema. |
Methods
$_addRule()
ts
$_addRule(rule: string | AddRuleOptions): Schema;Adds a rule to current validation schema.
Parameters
| Parameter | Type |
|---|---|
rule | string | AddRuleOptions |
Returns
Schema
$_compile()
ts
$_compile(schema: SchemaLike, options?: CompileOptions): Schema;Internally compiles schema.
Parameters
| Parameter | Type |
|---|---|
schema | SchemaLike |
options? | CompileOptions |
Returns
Schema
$_createError()
ts
$_createError(
code: string,
value: any,
context: ValidationContext,
state: State,
prefs: ValidationOptions,
options?: CreateErrorOptions): Err;Creates a joi error object.
Parameters
| Parameter | Type |
|---|---|
code | string |
value | any |
context | ValidationContext |
state | State |
prefs | ValidationOptions |
options? | CreateErrorOptions |
Returns
$_getFlag()
ts
$_getFlag(name: string): any;Get value from given flag.
Parameters
| Parameter | Type |
|---|---|
name | string |
Returns
any
$_getRule()
ts
$_getRule(name: string): GetRuleOptions | undefined;Retrieve some rule configuration.
Parameters
| Parameter | Type |
|---|---|
name | string |
Returns
GetRuleOptions | undefined
$_mapLabels()
ts
$_mapLabels(path: string | string[]): string;Parameters
| Parameter | Type |
|---|---|
path | string | string[] |
Returns
string
$_match()
ts
$_match(
value: any,
state: State,
prefs: ValidationOptions): boolean;Returns true if validations runs fine on given value.
Parameters
| Parameter | Type |
|---|---|
value | any |
state | State |
prefs | ValidationOptions |
Returns
boolean
$_modify()
ts
$_modify(options?: ModifyOptions): Schema;Parameters
| Parameter | Type |
|---|---|
options? | ModifyOptions |
Returns
Schema
$_mutateRebuild()
ts
$_mutateRebuild(): this;Resets current schema.
Returns
this
$_mutateRegister()
ts
$_mutateRegister(schema: Schema, options?: MutateRegisterOptions): void;Parameters
| Parameter | Type |
|---|---|
schema | Schema |
options? | MutateRegisterOptions |
Returns
void
$_property()
ts
$_property(name: string): any;Get value from given property.
Parameters
| Parameter | Type |
|---|---|
name | string |
Returns
any
$_reach()
ts
$_reach(path: string[]): Schema;Get schema at given path.
Parameters
| Parameter | Type |
|---|---|
path | string[] |
Returns
Schema
$_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
| Parameter | Type |
|---|---|
flag | string |
value | any |
options? | SetFlagOptions |
Returns
void
$_validate()
ts
$_validate(
value: any,
state: State,
prefs: ValidationOptions): ValidationResult;Runs internal validations against given value.
Parameters
| Parameter | Type |
|---|---|
value | any |
state | State |
prefs | ValidationOptions |