function safeNumberType (numberStr, config) {
  if (config.number === 'bigint') {
    try {
      BigInt(numberStr)
    } catch {
      return config.numberFallback
    }
  }

  return config.number
}
Ensure the number type is compatible with the provided value.
If not, return 'number' instead.

For example:

    safeNumberType('2.3', { number: 'bigint', numberFallback: 'number' })

will return 'number' and not 'bigint' because trying to create a bigint with
value 2.3 would throw an exception.

@param {string} numberStr
@param {{
  number: 'number' | 'BigNumber' | 'bigint' | 'Fraction'
  numberFallback: 'number' | 'BigNumber'
}} config
@returns {'number' | 'BigNumber' | 'bigint' | 'Fraction'}