First commit
This commit is contained in:
24
hGameTest/node_modules/sockjs-client/lib/utils/object.js
generated
vendored
Normal file
24
hGameTest/node_modules/sockjs-client/lib/utils/object.js
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = {
|
||||
isObject: function(obj) {
|
||||
var type = typeof obj;
|
||||
return type === 'function' || type === 'object' && !!obj;
|
||||
}
|
||||
|
||||
, extend: function(obj) {
|
||||
if (!this.isObject(obj)) {
|
||||
return obj;
|
||||
}
|
||||
var source, prop;
|
||||
for (var i = 1, length = arguments.length; i < length; i++) {
|
||||
source = arguments[i];
|
||||
for (prop in source) {
|
||||
if (Object.prototype.hasOwnProperty.call(source, prop)) {
|
||||
obj[prop] = source[prop];
|
||||
}
|
||||
}
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user