lib/ttb-util.js
function getCallArgs(platforms, args, cordovaVersion) {
    // Processes single platform string (or array of length 1) and an array of args or an object of args per platform
    args = args || [];
    if (typeof (platforms) == 'string') {
        platforms = [platforms];
    }
    
    // If only one platform is specified, check if the args is an object and use the args for this platform if so
    var options = args;
    if (platforms.length == 1 && !(args instanceof Array)) {
        options = args[platforms[0]];
    }
    
    // 5.4.0 changes the way arguments are passed to build. Rather than just having an array
    // of options, it needs to be an object with an "argv" member for the arguments.
    // A change was added in 6.0.0 that required the new format to be more complete.
    // Workaround for now is to use the old way that 6.0.0 has a fallback for.
    if (semver.valid(cordovaVersion) && semver.gte(cordovaVersion, '5.4.0') && semver.lt(cordovaVersion, '6.0.0')) {
        return { platforms: platforms, options: { argv: options } };
    } else {
        return { platforms: platforms, options: options };
    }
}
function getCallArgs(platforms, args, cordovaVersion) {
    // Processes single platform string (or array of length 1) and an array of args or an object of args per platform
    args = args || [];
    if (typeof (platforms) == 'string') {
        platforms = [platforms];
    }
    
    // If only one platform is specified, check if the args is an object and use the args for this platform if so
    var options = args;
    if (platforms.length == 1 && !(args instanceof Array)) {
        options = args[platforms[0]];
    }
    
    // 5.4.0 changes the way arguments are passed to build. Rather than just having an array
    // of options, it needs to be an object with an "argv" member for the arguments.
    // A change was added in 6.0.0 that required the new format to be more complete.
    // Workaround for now is to use the old way that 6.0.0 has a fallback for.
    if (semver.valid(cordovaVersion) && semver.gte(cordovaVersion, '5.4.0') && semver.lt(cordovaVersion, '6.0.0')) {
        return { platforms: platforms, options: { argv: options } };
    } else {
        return { platforms: platforms, options: options };
    }
}
function getCallArgs ( platforms , args , cordovaVersion ) { // Processes single platform string (or array of length 1) and an array of args or an object of args per platform args = args || [ ] ; if ( typeof ( platforms ) == 'string' ) { platforms = [ platforms ] ; } // If only one platform is specified, check if the args is an object and use the args for this platform if so var options = args ; if ( platforms . length == 1 && ! ( args instanceof Array ) ) { options = args [ platforms [ 0 ] ] ; } // 5.4.0 changes the way arguments are passed to build. Rather than just having an array // of options, it needs to be an object with an "argv" member for the arguments. // A change was added in 6.0.0 that required the new format to be more complete. // Workaround for now is to use the old way that 6.0.0 has a fallback for. if ( semver . valid ( cordovaVersion ) && semver . gte ( cordovaVersion , '5.4.0' ) && semver . lt ( cordovaVersion , '6.0.0' ) ) { return { platforms : platforms , options : { argv : options } } ; } else { return { platforms : platforms , options : options } ; } }
Utility method that coverts args into a consistant input understood by cordova-lib
Utility method that coverts args into a consistant input understood by cordova - lib