jsBigIntToDartBigInt function
This is only intended to be used by automatically generated code, instead of developers.
Implementation
BigInt jsBigIntToDartBigInt(dynamic raw) {
if (raw is int) return BigInt.from(raw);
if (raw is Object) {
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');
}