lib/collection/item-group.js
function (idOrName) {
        if (!_.isString(idOrName)) { return; }

        var item;

        this.items.each(function (eachItem) {
            if (eachItem.id === idOrName || eachItem.name === idOrName) {
                item = eachItem;
                return false; // we found something, so bail out of the for loop.
            }

            if (ItemGroup.isItemGroup(eachItem)) {
                item = eachItem.oneDeep(idOrName);
                return !item; // bail out of the for loop if we found anything
            }
        });

        return item;
    }
function (idOrName) {
        if (!_.isString(idOrName)) { return; }

        var item;

        this.items.each(function (eachItem) {
            if (eachItem.id === idOrName || eachItem.name === idOrName) {
                item = eachItem;
                return false; // we found something, so bail out of the for loop.
            }

            if (ItemGroup.isItemGroup(eachItem)) {
                item = eachItem.oneDeep(idOrName);
                return !item; // bail out of the for loop if we found anything
            }
        });

        return item;
    }
function ( idOrName ) { if ( ! _ . isString ( idOrName ) ) { return ; } var item ; this . items . each ( function ( eachItem ) { if ( eachItem . id === idOrName || eachItem . name === idOrName ) { item = eachItem ; return false ; // we found something, so bail out of the for loop. } if ( ItemGroup . isItemGroup ( eachItem ) ) { item = eachItem . oneDeep ( idOrName ) ; return ! item ; // bail out of the for loop if we found anything } } ) ; return item ; }
Finds the first item with the given name or id in the current ItemGroup.

@param {String} idOrName
Finds the first item with the given name or id in the current ItemGroup .