@fkui/logic
    Preparing search index...

    Function assertSet

    • Assertion function to assert that a value is set. Any value that is not null or undefined is considered set including falsy values such as 0 or "".

      Throws MissingValueError if value is not set.

      Type Parameters

      • T

      Parameters

      • value: undefined | null | T

        the value asserted to be set.

      • message: string = "Expected value to be set, but it was not"

        an optional exception message to use if the check fails.

      Returns asserts value is T

      const value = getValue();
      // ^? string | null

      assertSet(value);

      // value is now guaranteed to be non-null

      v6.15.0

      MissingValueError if value is not set.