dcoDecodePrimitiveInt function

int dcoDecodePrimitiveInt(
  1. Object? raw
)

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

Implementation

int dcoDecodePrimitiveInt(Object? raw) {
  if (raw is int) return raw;
  if (raw is double && raw.isFinite && raw == raw.truncateToDouble()) {
    return raw.toInt();
  }
  throw Exception(
    'dcoDecodePrimitiveInt see unexpected type=${raw.runtimeType} value=$raw',
  );
}