Skip to content

Commit

Permalink
bump 1.0.0 version for sound null safety.
Browse files Browse the repository at this point in the history
  • Loading branch information
jumperchen committed Apr 28, 2021
1 parent 071f4e7 commit 6cdb826
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 22 deletions.
6 changes: 1 addition & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
## 1.0.0-nullsafety.1

minor fix

## 1.0.0-nullsafety.0
## 1.0.0

**Features:**

Expand Down
1 change: 0 additions & 1 deletion lib/socket_io_common.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,3 @@ export 'src/engine/parser/parser.dart';
export 'src/engine/parser/wtf8.dart';
export 'src/parser/binary.dart';
export 'src/parser/parser.dart';

21 changes: 11 additions & 10 deletions lib/src/engine/parser/parser.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import 'dart:typed_data';

import 'package:socket_io_common/src/engine/parser/wtf8.dart';


// Protocol version
final protocol = 3;

Expand Down Expand Up @@ -62,17 +61,18 @@ class PacketParser {

if (packet['data'] != null) {
if (packet['data'] is Uint8List) {
return encodeBuffer(
packet, supportsBinary, callback, fromClient: fromClient);
} else
if (packet['data'] is Map && (packet['data']['buffer'] != null && packet['data']['buffer'] is ByteBuffer)) {
return encodeBuffer(packet, supportsBinary, callback,
fromClient: fromClient);
} else if (packet['data'] is Map &&
(packet['data']['buffer'] != null &&
packet['data']['buffer'] is ByteBuffer)) {
packet['data'] = (packet['data']['buffer'] as ByteBuffer).asUint8List();
return encodeBuffer(
packet, supportsBinary, callback, fromClient: fromClient);
return encodeBuffer(packet, supportsBinary, callback,
fromClient: fromClient);
} else if (packet['data'] is ByteBuffer) {
packet['data'] = (packet['data'] as ByteBuffer).asUint8List();
return encodeBuffer(
packet, supportsBinary, callback, fromClient: fromClient);
return encodeBuffer(packet, supportsBinary, callback,
fromClient: fromClient);
}
}

Expand Down Expand Up @@ -355,7 +355,8 @@ class PacketParser {
sizeBuffer[i + 1] = int.parse(encodingLength[i]);
}
sizeBuffer[sizeBuffer.length - 1] = 255;
return doneCallback(new List.from(sizeBuffer)..addAll(stringToBuffer(packet)));
return doneCallback(
new List.from(sizeBuffer)..addAll(stringToBuffer(packet)));
}

sizeBuffer = new Uint8List(encodingLength.length + 2);
Expand Down
3 changes: 2 additions & 1 deletion lib/src/parser/parser.dart
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,8 @@ class BinaryReconstructor {
this.buffers.add(binData);
if (this.buffers.length == this.reconPack['attachments']) {
// done with buffer list
var packet = Binary.reconstructPacket(this.reconPack, this.buffers.cast<List<int>>());
var packet = Binary.reconstructPacket(
this.reconPack, this.buffers.cast<List<int>>());
this.finishedReconstruction();
return packet;
}
Expand Down
6 changes: 4 additions & 2 deletions lib/src/util/event_emitter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,14 @@ class EventEmitter {
/**
* Mapping of events to a list of event handlers
*/
Map<String, List<EventHandler>> _events = new HashMap<String, List<EventHandler>>();
Map<String, List<EventHandler>> _events =
new HashMap<String, List<EventHandler>>();

/**
* Mapping of events to a list of one-time event handlers
*/
Map<String, List<EventHandler>> _eventsOnce = new HashMap<String, List<EventHandler>>();
Map<String, List<EventHandler>> _eventsOnce =
new HashMap<String, List<EventHandler>>();

/**
* Constructor
Expand Down
6 changes: 3 additions & 3 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: socket_io_common
description: Socket.io common parser library.
version: 1.0.0-nullsafety.1
version: 1.0.0
homepage: https://www.zkoss.org
repository: https://github.com/rikulo/socket_io_common
issue_tracker: https://github.com/rikulo/socket_io_common/issues

environment:
sdk: '>=2.12.0-0 <3.0.0'
sdk: '>=2.12.0 <3.0.0'

dependencies:
logging: '^1.0.0-nullsafety.0'
logging: '^1.0.1'

0 comments on commit 6cdb826

Please sign in to comment.