Skip to main content

types_as_array

Function types_as_array 

Source
pub fn types_as_array<I, B>(
    active_context: &Context<I, B>,
    type_alias: &str,
    options: Options,
) -> bool
Expand description

Checks whether the @type values of a node object are written as an array even when there is only one.

type_alias is what @type compacts to under active_context, as keyword_alias returns it. Follows the as array rule the compaction algorithm applies to @type: true when processing JSON-LD 1.1 and the alias’s container mapping includes @set, or when options.compact_arrays is off.