jsBigIntToDartBigInt function

BigInt jsBigIntToDartBigInt(
  1. Object raw
)

This is only intended to be used by automatically generated code, instead of developers.

Implementation

BigInt jsBigIntToDartBigInt(Object raw) {
  if (raw is int) return BigInt.from(raw);

  final jsAny = raw.jsify();
  if (jsAny.isA<JSBigInt>()) {
    final jsBigInt = jsAny as JSBigInt;
    return BigInt.parse(jsBigInt.toString());
  }

  throw Exception(
      'jsBigIntToDartBigInt see unexpected type=${raw.runtimeType} value=$raw');
}