src/Utility/Collection.js
/**
     * Add an object
     * If baseObject, add only if instance of baseObject
     * If no baseObject, add
     *
     * @param {String} key - The ID of the object
     * @param {T} value - The object data
     * @param {Boolean} replace - Whether to replace an existing object with the same ID
     * @returns {T} The existing or newly created object
     * @memberof Collection
     */
Add an object
If baseObject, add only if instance of baseObject
If no baseObject, add


Add an object If baseObject add only if instance of baseObject If no baseObject add
add(key, value, replace) {
        const existing = this.get(key);
        if (existing && !replace) {
            return existing;
        }
        if (this.baseObject && !(value instanceof this.baseObject) ) {
            return null;
        }
        this.set(key, value);
        return value;
    }
add ( key , value , replace ) { const existing = this . get ( key ) ; if ( existing && ! replace ) { return existing ; } if ( this . baseObject && ! ( value instanceof this . baseObject ) ) { return null ; } this . set ( key , value ) ; return value ; }
Add an object
 If baseObject, add only if instance of baseObject
 If no baseObject, add
Add an object If baseObject add only if instance of baseObject If no baseObject add