Skip to content

Interface: Reference

Extends

Properties

PropertyTypeDescriptionInherited from
adjust?(value: any) => anya function with the signature function(value) where value is the resolved reference value and the return value is the adjusted value to use. Note that the adjust feature will not perform any type validation on the adjusted value and it must match the value expected by the rule it is used in. Cannot be used with map. Example (value) => value + 5Exclude.adjust
ancestor?numberIf set to a number, sets the reference relative starting point. Cannot be combined with separator prefix characters. Defaults to the reference key prefix (or 1 if none present)Exclude.ancestor
depthnumber--
displaystring--
in?booleancreates an in-reference.Exclude.in
iterables?booleanwhen true, the reference resolves by reaching into maps and sets.Exclude.iterables
keystring--
map?[any, any][]an array of array pairs using the format [[key, value], [key, value]] used to maps the resolved reference value to another value. If the resolved value is not in the map, it is returned as-is. Cannot be used with adjust.Exclude.map
pathstring[]--
prefix?{ global?: string; local?: string; root?: string; }overrides default prefix characters.Exclude.prefix
prefix.global?stringreferences to the globally provided context preference. Default '$'-
prefix.local?stringreferences to error-specific or rule specific context. Default '#'-
prefix.root?stringreferences to the root value being validated. Default '/'-
render?booleanwhen true, the value of the reference is used instead of its name in error messages and template rendering. Defaults to false.Exclude.render
rootstring--
separator?string | falseoverrides the default . hierarchy separator. Set to false to treat the key as a literal value. Default '.'Exclude.separator
typestring--

Methods

toString()

ts
toString(): string;

Returns a string representation of an object.

Returns

string