mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-04 09:09:48 +08:00
7 lines
145 B
Dart
7 lines
145 B
Dart
int? safeToInt(dynamic value) => switch (value) {
|
|
int() => value,
|
|
String() => int.tryParse(value),
|
|
num() => value.toInt(),
|
|
_ => null,
|
|
};
|