Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ReferenceOptions

Hierarchy

Index

Properties

Optional adjust

0.0.46 provide
adjust: (value: any) => any

a 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 + 5

Type declaration

    • (value: any): any
    • Parameters

      • value: any

      Returns any

Optional ancestor

0.0.46 provide
ancestor: number

If 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)

Optional in

0.0.46 provide
in: boolean

creates an in-reference.

Optional iterables

0.0.46 provide
iterables: boolean

when true, the reference resolves by reaching into maps and sets.

Optional map

0.0.46 provide
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.

Optional prefix

0.0.46 provide
prefix: { global?: string; local?: string; root?: string }

overrides default prefix characters.

Type declaration

  • Optional global?: string

    references to the globally provided context preference.

    default

    '$'

  • Optional local?: string

    references to error-specific or rule specific context.

    default

    '#'

  • Optional root?: string

    references to the root value being validated.

    default

    '/'

Optional render

0.0.46 provide
render: boolean

when true, the value of the reference is used instead of its name in error messages and template rendering. Defaults to false.

Optional separator

0.0.46 provide
separator: string | false

overrides the default . hierarchy separator. Set to false to treat the key as a literal value.

default

'.'