LearnBoost/socket.io-client — Issue #322: io.util.merge doesn't work as expected on arrays
Author: LeRenard
Created: 2011-10-27 15:19:25+00:00
State: open

The merge function used for parsing incoming options and merging with defaults fails to merge arrays correctly.
This is visible by providing options like ```{transports: ["websocket", "flashsocket"] } ```

The result will be a contain xhr and so on...

The problem lies in the detection of objects and the "deep" parameter.
```typeof target[prop] !== "Object"``` will be false for arrays and thus will try to merge inside the transports array.

I replaced this detection by the jQuery function `$.isPlainObject(target[prop])`. I don't really know enough to use anything not from jQuery but I think you will come up with something.