encodeAsString static method

String encodeAsString(
  1. dynamic obj
)

Implementation

static String encodeAsString(obj) {
  var str = '${obj['type']}';

  if (binaryEventValue == obj['type'] || binaryAckValue == obj['type']) {
    str += '${obj['attachments']}-';
  }

  if (obj['nsp'] != null && '/' != obj['nsp']) {
    str += obj['nsp'] + ',';
  }

  if (null != obj['id']) {
    str += '${obj['id']}';
  }

  if (null != obj['data']) {
    str += json.encode(obj['data']);
  }

  return str;
}