@webdeveric/utils
    Preparing search index...
    • Assert that input is a string that matches the given pattern.

      Parameters

      • input: unknown
      • pattern: RegExp
      • error: string | Error = 'input is not a string that matches the pattern'

      Returns asserts input is string

      assertIsStringMatching('hello', /^h/); // does not throw
      assertIsStringMatching('world', /^h/); // throws TypeError: input is not a string that matches the pattern