HED JavaScript Library
    Preparing search index...

    A schema value class.

    Hierarchy (View Summary)

    Index
    • Constructor.

      Parameters

      • name: string

        The name of this value class.

      • description: string | undefined

        The description of this value class.

      • booleanAttributes: Set<SchemaAttribute>

        The boolean attributes for this value class.

      • valueAttributes: Map<SchemaAttribute, string[]>

        The value attributes for this value class.

      • allowedNames: string[] = []

        The character set names that define the class's characters.

      Returns default

    _description: string | undefined

    The description of this schema entry.

    _name: string

    The name of this schema entry.

    _wordRegex: RegExp | null

    The whole-value regular expression of this class (character_sets.json value_class_words), or null.

    allowedNames: string[]

    The character set names (character_sets.json) that define this class's characters; empty for no constraint.

    booleanAttributeNames: Set<string>

    The set of boolean attribute names this schema entry has.

    booleanAttributes: Set<SchemaAttribute>

    The set of boolean attributes this schema entry has.

    valueAttributeNames: Map<string, string[]>

    The collection of value attribute names this schema entry has.

    valueAttributes: Map<SchemaAttribute, string[]>

    The collection of value attributes this schema entry has.

    IGNORED_ATTRIBUTES: Set<string> = ...

    The attributes ignored when comparing two declarations of an element: inLibrary names the declaring library and hedId differs between schemas by construction.

    • get description(): string | undefined

      The description of this schema entry.

      Returns string | undefined

    • Determine if this schema value class is equivalent to another schema value class.

      Value classes are equivalent if they have the same name, description, attributes, and allowed characters (in any order, as for the attribute values).

      Parameters

      • other: any

        A schema value class to compare with this one.

      Returns boolean

      Whether the other value class is equivalent to this schema value class.

    • Retrieve a single value of a value attribute (by name) on this schema entry, throwing an error if more than one value exists.

      Parameters

      • attributeName: string

        The attribute whose value should be returned.

      Returns string | undefined

      The value of the attribute.

      If the attribute has more than one value.

    • Determine if a value is valid according to this value class.

      Parameters

      • value: string

        A HED value.

      Returns boolean

      Whether the value conforms to this value class.

    • Say why a value fails this class, checking the whole-value rule before the characters, as hed-python does.

      Parameters

      • value: string

        A HED value.

      Returns { rule: true } | { characters: [number, string][] } | null

      null if the value is valid; {rule: true} if it is empty, breaks the class's whole-value rule, or (dateTimeClass) names a date that does not exist; otherwise the characters the class does not allow, as [index, character] pairs.