         let nspString = binaryCountString + (nsp != "/" ? "\(nsp)," : "")
         // Ack number?
         let idString = nspString + (id != -1 ? String(id) : "")
-        
+
         return completeMessage(idString)
     }
-    
+
     // Called when we have all the binary data for a packet
     // calls _fillInPlaceholders, which replaces placeholders with the
     // corresponding binary
     private mutating func fillInPlaceholders() {
         data = data.map(_fillInPlaceholders)
     }
-    
+
     // Helper method that looks for placeholders
     // If object is a collection it will recurse
     // Returns the object if it is not a placeholder or the corresponding

    // Recursive function that looks for NSData in collections
    static func shred(_ data: Any, binary: inout [Data]) -> Any {
        let placeholder = ["_placeholder": true, "num": binary.count] as JSON
        
        switch data {
        case let bin as Data:
            binary.append(bin)
            
            return placeholder
        case let arr as [Any]:
            return arr.map({shred($0, binary: &binary)})
        case let dict as JSON:
            return dict.reduce(JSON(), {cur, keyValue in
                var mutCur = cur
                
                mutCur[keyValue.0] = shred(keyValue.1, binary: &binary)
                
                return mutCur
            })
        default:
            return data
        }
    }
    
    // Removes binary data from emit data
    // Returns a type containing the de-binaryed data and the binary
    static func deconstructData(_ data: [Any]) -> ([Any], [Data]) {
        var binary = [Data]()
        
        return (data.map({shred($0, binary: &binary)}), binary)
    }
}

    enum PacketType: Int {
        case connect, disconnect, event, ack, error, binaryEvent, binaryAck
    }

    private let placeholders: Int

    private static let logType = "SocketPacket"

    let nsp: String
    let id: Int
    let type: PacketType

    var binary: [Data]
    var data: [Any]
    var args: [Any] {
