mirror of
https://github.com/socketio/socket.io.git
synced 2026-04-30 03:00:39 -04:00
Reference: https://github.com/websockets/ws/blob/master/doc/ws.md#new-websocketaddress-protocols-options Related: - https://github.com/socketio/engine.io-client/issues/574 - https://github.com/socketio/engine.io-client/issues/615
9 lines
168 B
JavaScript
9 lines
168 B
JavaScript
module.exports.pick = (obj, ...attr) => {
|
|
return attr.reduce((acc, k) => {
|
|
if (obj.hasOwnProperty(k)) {
|
|
acc[k] = obj[k];
|
|
}
|
|
return acc;
|
|
}, {});
|
|
};
|