zklib
Version:
Attendance Machine Library for NodeJS with a connection to the network using the UDP protocol and port 4370
16 lines (11 loc) • 425 B
JavaScript
module.exports = (parentClass, mixinClass) => {
const methods = Object.getOwnPropertyNames(mixinClass.prototype);
for (let i = 0; i < methods.length; i++) {
const method = methods[i];
if (method == 'constructor') continue;
if (parentClass.prototype[method]) {
throw new Error(`Method ${method} is already implemented`);
}
parentClass.prototype[method] = mixinClass.prototype[method];
}
};