class Model {

    constructor() {
        if (this.constructor === Model) {
            throw new Error("Model is an abstract class, you must extend it from another class like class Foobar extends Model {}");
        }
    }

    /*
     * Copy and clean object exclusing properties given by updateExclusion()
     * 
     * @param {object} source
     * @param {object} target
     * @returns {object}
     */
    update(source, target) {
        if (target === undefined) {
            target = {};
        }
        if (typeof source !== 'object') {
            throw new Error("First parameter of updateExclusion() must be an object, " + typeof source + " provided");
        }
        if (typeof target !== 'object') {
            throw new Error("Second parameter of updateExclusion() must be an object, " + typeof target + " provided");
        }
        if (typeof this.updateExclusion !== 'function') {
            throw new Error("Missing function updateExclusion() in " + this.constructor.name);
        }
        const excluded = this.updateExclusion();
        if (Array.isArray(excluded) === false) {
            throw new Error("Function updateExclusion() must return an array, " + typeof excluded + " provided");
        }
        for (var sourceKey in source) {
            let found = false;
            for (let i = 0, length = excluded.length; i < length; i++) {
                if (sourceKey === excluded[i]) {
                    found = true;
                    break;
                }
            }
            if (found === false) {
                if (source[sourceKey] === null) {
                    delete target[sourceKey];
                } else if (source[sourceKey] === "") {
                    target[sourceKey] = null;
                } else {
                    target[sourceKey] = source[sourceKey];
                }
            }
        }
        return target;
    }

    /*
     * Make a copy of the source object and remove properties given by cleanInclusion()
     * 
     * @param {object} source
     * @returns {object}
     */
    clean(source) {
        const target = Object.assign({}, source);
        if (typeof target !== 'object') {
            throw new Error("First parameter of cleanInclusion() must be an object, " + typeof target + " provided");
        }
        if (typeof this.cleanInclusion !== 'function') {
            throw new Error("Missing function cleanInclusion() in " + this.constructor.name);
        }
        const excluded = this.cleanInclusion();
        if (Array.isArray(excluded) === false) {
            throw new Error("Function cleanInclusion() must return an array, " + typeof excluded + " provided");
        }
        for (let i = 0, length = excluded.length; i < length; i++) {
            if (target[excluded[i]]) {
                delete target[excluded[i]];
            }
        }
        return target;
    }

}

module.exports = Model;


@@ -1,18 +1,75 @@
 c
-lass Model %7B%0A
+onst Console = require('./console.js');%0A%0Aclass Model extends Console %7B
 %0A   
@@ -81,24 +81,41 @@
 tructor() %7B%0A
+        super();%0A
         if (
@@ -711,28 +711,34 @@
 t, %22 + t
-ypeof 
+his.typeOf(
 source
+)
  + %22 pro
@@ -885,36 +885,42 @@
 bject, %22 + t
-ypeof target
+his.typeOf(source)
  + %22 provide
@@ -1274,38 +1274,43 @@
 array, %22 + t
-ypeof 
+his.typeOf(
 excluded
  + %22 provide
@@ -1289,32 +1289,33 @@
 .typeOf(excluded
+)
  + %22 provided%22);
@@ -2366,28 +2366,34 @@
 t, %22 + t
-ypeof 
+his.typeOf(
 target
+)
  + %22 pro
@@ -2755,22 +2755,27 @@
  + t
-ypeof 
+his.typeOf(
 excluded
  + %22
@@ -2770,16 +2770,17 @@
 excluded
+)
  + %22 pro

Add console as base class of model