mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-08 18:54:21 +01:00
20 lines
387 B
Dart
20 lines
387 B
Dart
import 'dart:typed_data';
|
|
|
|
import 'package:turso_dart/src/rust/helpers/value.dart';
|
|
|
|
Value toValue(dynamic value) {
|
|
if (value is int) {
|
|
return Value.integer(value);
|
|
}
|
|
if (value is double) {
|
|
return Value.real(value);
|
|
}
|
|
if (value is String) {
|
|
return Value.text(value);
|
|
}
|
|
if (value is Uint8List) {
|
|
return Value.blob(value);
|
|
}
|
|
return const Value.null_();
|
|
}
|