pogobuf/pogobuf.utils.js
function(templates) {
        if (!templates || !templates.success || !templates.item_templates) return {};

        var ret = {
            pokemon_settings: [],
            item_settings: [],
            move_settings: [],
            move_sequence_settings: [],
            type_effective_settings: [],
            badge_settings: [],
            camera_settings: null,
            player_level_settings: null,
            gym_level_settings: null,
            battle_settings: null,
            encounter_settings: null,
            iap_item_display: [],
            iap_settings: null,
            pokemon_upgrade_settings: null,
            equipped_badge_settings: null
        };

        templates.item_templates.forEach(template => {
            if (template.pokemon_settings) {
                ret.pokemon_settings.push(template.pokemon_settings);
            }
            if (template.item_settings) {
                ret.item_settings.push(template.item_settings);
            }
            if (template.move_settings) {
                ret.move_settings.push(template.move_settings);
            }
            if (template.move_sequence_settings) {
                ret.move_sequence_settings.push(template.move_sequence_settings.sequence);
            }
            if (template.type_effective) {
                ret.type_effective_settings.push(template.type_effective);
            }
            if (template.badge_settings) {
                ret.badge_settings.push(template.badge_settings);
            }
            if (template.camera) {
                ret.camera_settings = template.camera;
            }
            if (template.player_level) {
                ret.player_level_settings = template.player_level;
            }
            if (template.gym_level) {
                ret.gym_level_settings = template.gym_level;
            }
            if (template.battle_settings) {
                ret.battle_settings = template.battle_settings;
            }
            if (template.encounter_settings) {
                ret.encounter_settings = template.encounter_settings;
            }
            if (template.iap_item_display) {
                ret.iap_item_display.push(template.iap_item_display);
            }
            if (template.iap_settings) {
                ret.iap_settings = template.iap_settings;
            }
            if (template.pokemon_upgrades) {
                ret.pokemon_upgrade_settings = template.pokemon_upgrades;
            }
            if (template.equipped_badges) {
                ret.equipped_badge_settings = template.equipped_badges;
            }
        });

        return ret;
    }
function(templates) {
        if (!templates || !templates.success || !templates.item_templates) return {};

        var ret = {
            pokemon_settings: [],
            item_settings: [],
            move_settings: [],
            move_sequence_settings: [],
            type_effective_settings: [],
            badge_settings: [],
            camera_settings: null,
            player_level_settings: null,
            gym_level_settings: null,
            battle_settings: null,
            encounter_settings: null,
            iap_item_display: [],
            iap_settings: null,
            pokemon_upgrade_settings: null,
            equipped_badge_settings: null
        };

        templates.item_templates.forEach(template => {
            if (template.pokemon_settings) {
                ret.pokemon_settings.push(template.pokemon_settings);
            }
            if (template.item_settings) {
                ret.item_settings.push(template.item_settings);
            }
            if (template.move_settings) {
                ret.move_settings.push(template.move_settings);
            }
            if (template.move_sequence_settings) {
                ret.move_sequence_settings.push(template.move_sequence_settings.sequence);
            }
            if (template.type_effective) {
                ret.type_effective_settings.push(template.type_effective);
            }
            if (template.badge_settings) {
                ret.badge_settings.push(template.badge_settings);
            }
            if (template.camera) {
                ret.camera_settings = template.camera;
            }
            if (template.player_level) {
                ret.player_level_settings = template.player_level;
            }
            if (template.gym_level) {
                ret.gym_level_settings = template.gym_level;
            }
            if (template.battle_settings) {
                ret.battle_settings = template.battle_settings;
            }
            if (template.encounter_settings) {
                ret.encounter_settings = template.encounter_settings;
            }
            if (template.iap_item_display) {
                ret.iap_item_display.push(template.iap_item_display);
            }
            if (template.iap_settings) {
                ret.iap_settings = template.iap_settings;
            }
            if (template.pokemon_upgrades) {
                ret.pokemon_upgrade_settings = template.pokemon_upgrades;
            }
            if (template.equipped_badges) {
                ret.equipped_badge_settings = template.equipped_badges;
            }
        });

        return ret;
    }
Takes a downloadItemTemplates() response and separates it into the individual
settings objects.
@param {object} templates - API response message as returned by downloadItemTemplates()
@returns {object}
@static