# all files / keystone/lib/core/ getOrphanedLists.js

33.33% Statements 3/9
0% Branches 0/6
0% Functions 0/2
37.5% Lines 3/8

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    181×

    1×

    1×
     var _ = require('lodash');

    /**
     * Retrieves orphaned lists (those not in a nav section)
     */

    function getOrphanedLists () {
    	if (!this.nav) {
    		return [];
    	}
    	return _.filter(this.lists, function (list, key) {
    		if (list.get('hidden')) return false;
    		return (!this.nav.by.list[key]) ? list : false;
    	}.bind(this));
    }

    module.exports = getOrphanedLists;