@webdeveric/utils
    Preparing search index...
    • Assert that input is a string or undefined.

      Parameters

      • input: unknown
      • error: string | Error = 'input is not an optional string'

      Returns asserts input is string | undefined

      assertIsOptionalString('hello'); // does not throw
      assertIsOptionalString(undefined); // does not throw
      assertIsOptionalString(42); // throws TypeError: input is not an optional string