odoo-13.0/addons/web/static/src/js/widgets/domain_selector.js
/**
 * Instantiates a DomainTree if the given domain contains several parts and a
 * DomainLeaf if it only contains one part. Returns null otherwise.
 *
 * @param {Object} parent
 * @param {string} model - the model name
 * @param {Array|string} domain - the prefix representation of the domain
 * @param {Object} options - @see DomainNode.init.options
 * @returns {DomainTree|DomainLeaf|null}
 */
Instantiates a DomainTree if the given domain contains several parts and a
DomainLeaf if it only contains one part. Returns null otherwise.


Instantiates a DomainTree if the given domain contains several parts and a DomainLeaf if it only contains one part . Returns null otherwise .
function instantiateNode(parent, model, domain, options) {
    if (domain.length > 1) {
        return new DomainTree(parent, model, domain, options);
    } else if (domain.length === 1) {
        return new DomainLeaf(parent, model, domain, options);
    }
    return null;
}
function instantiateNode ( parent , model , domain , options ) { if ( domain . length > 1 ) { return new DomainTree ( parent , model , domain , options ) ; } else if ( domain . length === 1 ) { return new DomainLeaf ( parent , model , domain , options ) ; } return null ; }
Instantiates a DomainTree if the given domain contains several parts and a
 DomainLeaf if it only contains one part.
Instantiates a DomainTree if the given domain contains several parts and a DomainLeaf if it only contains one part .