lookupModel(selector = '*') {
        const {model, publishMode, parent} = this,
            modeIsDefault = (publishMode === ModelPublishMode.DEFAULT);

        // Try this model - but only accept wildcard for default mode!
        if (matchesSelector(model, selector, modeIsDefault)) {
            return model;
        }

        // Potentially try this model's direct children, do not accept wildcard
        if (modeIsDefault) {
            let ret = null;
            forOwn(model, (value) => {
                if (matchesSelector(value, selector)) {
                    ret = value;
                    return false;
                }
            });
            if (ret) return ret;
        }

        // Try parent
        return parent?.lookupModel(selector) ?? null;
    }
/**
     * Lookup a model in the context hierarchy
     *
     * @param {ModelSelector} selector - type of model to lookup.
     * @returns {HoistModel} - model, or null if no matching model found.
     */
Lookup a model in the context hierarchy
@param {ModelSelector} selector - type of model to lookup.
@returns {HoistModel} - model, or null if no matching model found.
Lookup a model in the context hierarchy @param { ModelSelector } selector - type of model to lookup . @returns { HoistModel } - model or null if no matching model found .
lookupModel(selector = '*') {
        const {model, publishMode, parent} = this,
            modeIsDefault = (publishMode === ModelPublishMode.DEFAULT);
        if (matchesSelector(model, selector, modeIsDefault)) {
            return model;
        }
        if (modeIsDefault) {
            let ret = null;
            forOwn(model, (value) => {
                if (matchesSelector(value, selector)) {
                    ret = value;
                    return false;
                }
            });
            if (ret) return ret;
        }
        return parent?.lookupModel(selector) ?? null;
    }
lookupModel ( selector = '*' ) { const { model , publishMode , parent } = this , modeIsDefault = ( publishMode === ModelPublishMode . DEFAULT ) ; if ( matchesSelector ( model , selector , modeIsDefault ) ) { return model ; } if ( modeIsDefault ) { let ret = null ; forOwn ( model , ( value ) => { if ( matchesSelector ( value , selector ) ) { ret = value ; return false ; } } ) ; if ( ret ) return ret ; } return parent ?. lookupModel ( selector ) ?? null ; }
Lookup a model in the context hierarchy
 @param {ModelSelector} selector - type of model to lookup.
Lookup a model in the context hierarchy @param { ModelSelector } selector - type of model to lookup .
// Try this model - but only accept wildcard for default mode! // Potentially try this model's direct children, do not accept wildcard // Try parent