TomTom Maps for JavaScript
    Preparing search index...

    Function validateKnobValue

    • Checks a value against a catalogue entry's kind, options and range, as far as the range's bounds hold.

      Parameters

      • knob: KnobEntry<string>

        The knob's entry in its catalogue.

      • value: unknown

      Returns void

      A color must parse as a CSS colour. An image or text value need only be a string. Only a loaded map knows whether the sprite has the image.

      RangeError naming the knob and what it expects, for a value it does not take.

      const knob = knobEntryOf(trafficIncidentsKnobCatalogue, 'filters.magnitudes.values');
      validateKnobValue(knob, ['major', 'severe']); // RangeError: … 'severe' is not