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

      Parameters

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

      Returns asserts input is symbol | undefined

      assertIsOptionalSymbol(Symbol('id')); // does not throw
      assertIsOptionalSymbol(undefined); // does not throw
      assertIsOptionalSymbol('id'); // throws TypeError: input is not an optional symbol