src/selectivity.js
function(item) {
        if (item && Selectivity.isValidId(item.id) && isString(item.text)) {
            return item;
        } else {
            throw new Error('Item should have id (number or string) and text (string) properties');
        }
    }
function(item) {
        if (item && Selectivity.isValidId(item.id) && isString(item.text)) {
            return item;
        } else {
            throw new Error('Item should have id (number or string) and text (string) properties');
        }
    }
function ( item ) { if ( item && Selectivity . isValidId ( item . id ) && isString ( item . text ) ) { return item ; } else { throw new Error ( 'Item should have id (number or string) and text (string) properties' ) ; } }
Validates a single item. Throws an exception if the item is invalid.

@param item The item to validate.

@return The validated item. May differ from the input item.
Validates a single item . Throws an exception if the item is invalid .