hooks/lib.js
function (rootdir, configData, platform) {
        var configFiles = lib.getConfigFilesByTargetAndParent(rootdir, platform),
            type = 'configFile';

        for (var key in configFiles) {
            if (configFiles.hasOwnProperty(key)) {
                var configFile = configFiles[key];

                var keyParts = key.split('|');
                var target = keyParts[0];
                var parent = keyParts[1];
                var items = configData[target] || [];

                configFile.getchildren().forEach(function (element) {
                    items.push({
                        parent: parent,
                        type: type,
                        destination: element.tag,
                        data: element
                    });
                });

                configData[target] = items;
            }
        }
    }
function (rootdir, configData, platform) {
        var configFiles = lib.getConfigFilesByTargetAndParent(rootdir, platform),
            type = 'configFile';

        for (var key in configFiles) {
            if (configFiles.hasOwnProperty(key)) {
                var configFile = configFiles[key];

                var keyParts = key.split('|');
                var target = keyParts[0];
                var parent = keyParts[1];
                var items = configData[target] || [];

                configFile.getchildren().forEach(function (element) {
                    items.push({
                        parent: parent,
                        type: type,
                        destination: element.tag,
                        data: element
                    });
                });

                configData[target] = items;
            }
        }
    }
function ( rootdir , configData , platform ) { var configFiles = lib . getConfigFilesByTargetAndParent ( rootdir , platform ) , type = 'configFile' ; for ( var key in configFiles ) { if ( configFiles . hasOwnProperty ( key ) ) { var configFile = configFiles [ key ] ; var keyParts = key . split ( '|' ) ; var target = keyParts [ 0 ] ; var parent = keyParts [ 1 ] ; var items = configData [ target ] || [ ] ; configFile . getchildren ( ) . forEach ( function ( element ) { items . push ( { parent : parent , type : type , destination : element . tag , data : element } ) ; } ) ; configData [ target ] = items ; } } }
Retrieves the config.xml's config-file elements for a given
platform and parses them into JSON data
@param configData
@param platform
Retrieves the config . xml s config - file elements for a given platform and parses them into JSON data