@webdeveric/utils
    Preparing search index...
    • Assert that input is a number, bigint, or numeric string.

      Parameters

      • input: unknown
      • error: string | Error = 'input is not a numerical value'

      Returns asserts input is NumericValue

      assertIsNumericValue(42); // does not throw
      assertIsNumericValue('42'); // does not throw
      assertIsNumericValue(42n); // does not throw
      assertIsNumericValue('abc'); // throws TypeError: input is not a numerical value