webOptionalInt function
Converts a JavaScript number into a Dart integer without trusting its shape.
Implementation
int? webOptionalInt(Object? value) => switch (value) {
final int number => number,
final num number => number.toInt(),
_ => null,
};