webOptionalInt function

int? webOptionalInt(
  1. Object? value
)

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,
};