10 lines
343 B
JavaScript
10 lines
343 B
JavaScript
|
exports.inherits = function (newClass, baseClass) {
|
||
|
Object.keys(baseClass).forEach(function (classMethod) {
|
||
|
newClass[classMethod] = baseClass[classMethod];
|
||
|
});
|
||
|
Object.keys(baseClass.prototype).forEach(function (instanceMethod) {
|
||
|
newClass.prototype[instanceMethod] = baseClass.prototype[instanceMethod];
|
||
|
});
|
||
|
};
|
||
|
|