Skip to content

Commit

Permalink
[sembast] fix onCountSync
Browse files Browse the repository at this point in the history
  • Loading branch information
alextekartik committed Nov 27, 2024
1 parent c828f5d commit d98868a
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sembast/lib/src/query_ref_impl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -323,5 +323,5 @@ extension SembastQueryRefSyncExtension<K, V> on QueryRef<K, V> {
///
/// first emit happens synchronously.
Stream<int> onCountSync(Database database) =>
onKeys(database).map((e) => e.length);
onKeysSync(database).map((e) => e.length);
}
9 changes: 8 additions & 1 deletion sembast_test/lib/encrypt_codec.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,14 @@ import 'package:encrypt/encrypt.dart';
// ignore: implementation_imports
import 'package:sembast/src/api/v2/sembast.dart';

var _random = Random.secure();
final _random = () {
try {
// Try secure
return Random.secure();
} catch (_) {
return Random();
}
}();

/// Random bytes generator
Uint8List _randBytes(int length) {
Expand Down
11 changes: 11 additions & 0 deletions sembast_test/tool/node_test_run.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import 'package:process_run/shell_run.dart';

Future main() async {
var shell = Shell();

await shell.run('''
dart test --platform node --compiler dart2js
''');
}
File renamed without changes.

0 comments on commit d98868a

Please sign in to comment.