Skip to content

Commit

Permalink
feat(dynamite_runtime): export HttpBytesStreamExtension
Browse files Browse the repository at this point in the history
Signed-off-by: Nikolas Rimikis <leptopoda@users.noreply.github.com>
  • Loading branch information
Leptopoda committed Apr 2, 2024
1 parent c5fa6f6 commit 7ed974c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import 'package:xml/xml_events.dart';
final xmlConverter = XmlEventDecoder().fuse(const XmlNormalizeEvents()).fuse(const XmlNodeDecoder());

/// Extension on byte streams that enable efficient transformations.
@internal
extension HttpBytesStreamExtension on http.ByteStream {
/// Collects the data of this stream in a [Uint8List].
///
Expand All @@ -35,7 +34,7 @@ extension HttpBytesStreamExtension on http.ByteStream {

/// Collect the data of this stream in [XmlElement], decoded according to
/// [encoding], which defaults to [utf8].
Future<Object?> bytesToXml([Encoding encoding = utf8]) async {
Future<XmlElement?> bytesToXml([Encoding encoding = utf8]) async {
final element = await encoding.decoder
.fuse(xmlConverter)
.bind(this)
Expand All @@ -52,7 +51,6 @@ extension HttpBytesStreamExtension on http.ByteStream {
/// charset is unknown.
///
/// Copied from `package:http`.
@internal
Encoding encodingForHeaders(Map<String, String> headers) =>
_encodingForCharset(_contentTypeForHeaders(headers).parameters['charset']);

Expand Down
1 change: 1 addition & 0 deletions packages/dynamite/dynamite_runtime/lib/utils.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/// Utility functions used by the generated code.
library utils;

export 'src/utils/byte_stream_extension.dart';
export 'src/utils/codecs.dart';
export 'src/utils/some_of_validators.dart';
export 'src/utils/string_checker.dart';
Expand Down

0 comments on commit 7ed974c

Please sign in to comment.