Skip to content

Commit

Permalink
Fix compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
nirinchev committed Jun 24, 2024
1 parent afb7882 commit 2b77af8
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/ejson/lib/src/decoding.dart
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ UndefinedOr<T> _decodeUndefinedOr<T>(EJsonValue ejson) {

Uuid _decodeUuid(EJsonValue ejson) {
return switch (ejson) {
{'\$binary': {'base64': String s, 'subType': '04'}} => Uuid.fromBytes(base64.decode(s).buffer),
{'\$binary': {'base64': String s, 'subType': '04'}} => Uuid.fromBytes(base64.decode(s)),
_ => raiseInvalidEJson(ejson),
};
}
Expand Down
2 changes: 1 addition & 1 deletion packages/ejson/lib/src/encoding.dart
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ EJsonValue _encodeSymbol(Symbol value) => {'\$symbol': value.name};

EJsonValue _encodeUndefined(Undefined<dynamic> undefined) => {'\$undefined': 1};

EJsonValue _encodeUuid(Uuid uuid) => _encodeBinary(uuid.bytes.asUint8List(), subtype: '04');
EJsonValue _encodeUuid(Uuid uuid) => _encodeBinary(uuid.bytes, subtype: '04');

EJsonValue _encodeBinary(Uint8List buffer, {required String subtype}) => {
'\$binary': {
Expand Down
4 changes: 2 additions & 2 deletions packages/ejson/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: ejson
description: >-
EJSON serialization.
BSON is a binary format used to store JSON-like documents efficiently.
BSON is a binary format used to store JSON-like documents efficiently.
EJSON extends JSON defining how all BSON types should be represented in JSON.
topics:
Expand All @@ -22,7 +22,7 @@ dependencies:
collection: ^1.17.0
ejson_annotation: ^0.3.0
objectid: ^3.0.0
sane_uuid: ^1.0.0-alpha.5
sane_uuid: ^1.0.1
type_plus: ^2.0.0

dev_dependencies:
Expand Down
2 changes: 1 addition & 1 deletion packages/realm_common/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ environment:
dependencies:
collection: ^1.18.0
objectid: ^3.0.0
sane_uuid: ^1.0.0-alpha.5
sane_uuid: ^1.0.1

dev_dependencies:
lints: ^3.0.0

0 comments on commit 2b77af8

Please sign in to comment.