define(function () {
function extend(obj) {
var type = typeof obj;
if (!(type === 'function' || type === 'object' && !!obj)) {
return obj;
}
var source, prop;
for (var i = 1, length = arguments.length; i < length; i++) {
source = arguments[i];
for (prop in source) {
obj[prop] = source[prop];
}
}
return obj;
};
function fnExtend(protoProps, staticProps) {
var parent = this;
var child;
if (protoProps && protoProps != null &&
hasOwnProperty.call(protoProps, 'constructor')) {
child = protoProps.constructor;
} else {
child = function () {
return parent.apply(this, arguments);
};
}
extend(child, parent, staticProps);
var Surrogate = function () {
this.constructor = child;
};
Surrogate.prototype = parent.prototype;
child.prototype = new Surrogate;
if (protoProps) {
extend(child.prototype, protoProps);
}
child.__super__ = parent.prototype;
return child;
};
function isString(obj) {
return toString.call(obj) === '[object String]';
}
function isObject(obj) {
return obj === Object(obj);
}
function isArray(obj) {
return (Array.isArray) ? Array.isArray(obj) : toString.call(obj) === '[object Array]';
}
return {
fnExtend: fnExtend,