Skip to content

Commit 38f9ff3

Browse files
authored
Merge pull request #127 from powersync-ja/chore/merge-master-alpha-release-2
Merge master to alpha release
2 parents d2b8eeb + c289e8d commit 38f9ff3

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

packages/powersync/lib/src/stream_utils.dart

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,13 @@ Stream<Object?> ndjson(ByteStream input) {
6868
return jsonInput;
6969
}
7070

71+
/// Given a raw ByteStream, parse each line as JSON.
72+
Stream<String> newlines(ByteStream input) {
73+
final textInput = input.transform(convert.utf8.decoder);
74+
final lineInput = textInput.transform(const convert.LineSplitter());
75+
return lineInput;
76+
}
77+
7178
void pauseAll(List<StreamSubscription> subscriptions) {
7279
for (var sub in subscriptions) {
7380
sub.pause();

0 commit comments

Comments
 (0)