site/semantic/tasks/config/project/config.js
function(config) {

    config = config || extend(false, {}, defaults);

    /*--------------
       File Paths
    ---------------*/

    var
      configPath = this.getPath(),
      sourcePaths = {},
      outputPaths = {},
      folder
    ;

    // resolve paths (config location + base + path)
    for(folder in config.paths.source) {
      if(config.paths.source.hasOwnProperty(folder)) {
        sourcePaths[folder] = path.resolve(path.join(configPath, config.base, config.paths.source[folder]));
      }
    }
    for(folder in config.paths.output) {
      if(config.paths.output.hasOwnProperty(folder)) {
        outputPaths[folder] = path.resolve(path.join(configPath, config.base, config.paths.output[folder]));
      }
    }

    // set config paths to full paths
    config.paths.source = sourcePaths;
    config.paths.output = outputPaths;

    // resolve "clean" command path
    config.paths.clean = path.resolve( path.join(configPath, config.base, config.paths.clean) );

    /*--------------
        CSS URLs
    ---------------*/

    // determine asset paths in css by finding relative path between themes and output
    // force forward slashes

    config.paths.assets = {
      source       : '../../themes', // source asset path is always the same
      uncompressed : './' + path.relative(config.paths.output.uncompressed, config.paths.output.themes).replace(/\\/g, '/'),
      compressed   : './' + path.relative(config.paths.output.compressed, config.paths.output.themes).replace(/\\/g, '/'),
      packaged     : './' + path.relative(config.paths.output.packaged, config.paths.output.themes).replace(/\\/g, '/')
    };

    /*--------------
       Permission
    ---------------*/

    if(config.permission) {
      config.hasPermissions = true;
    }
    else {
      // pass blank object to avoid causing errors
      config.permission     = {};
      config.hasPermissions = false;
    }

    /*--------------
         Globs
    ---------------*/

    if(!config.globs) {
      config.globs = {};
    }

    // remove duplicates from component array
    if(config.components instanceof Array) {
      config.components = config.components.filter(function(component, index) {
        return config.components.indexOf(component) == index;
      });
    }

    // takes component object and creates file glob matching selected components
    config.globs.components = (typeof config.components == 'object')
      ? (config.components.length > 1)
        ? '{' + config.components.join(',') + '}'
        : config.components[0]
      : '{' + defaults.components.join(',') + '}'
    ;

    return config;

  }
function(config) {

    config = config || extend(false, {}, defaults);

    /*--------------
       File Paths
    ---------------*/

    var
      configPath = this.getPath(),
      sourcePaths = {},
      outputPaths = {},
      folder
    ;

    // resolve paths (config location + base + path)
    for(folder in config.paths.source) {
      if(config.paths.source.hasOwnProperty(folder)) {
        sourcePaths[folder] = path.resolve(path.join(configPath, config.base, config.paths.source[folder]));
      }
    }
    for(folder in config.paths.output) {
      if(config.paths.output.hasOwnProperty(folder)) {
        outputPaths[folder] = path.resolve(path.join(configPath, config.base, config.paths.output[folder]));
      }
    }

    // set config paths to full paths
    config.paths.source = sourcePaths;
    config.paths.output = outputPaths;

    // resolve "clean" command path
    config.paths.clean = path.resolve( path.join(configPath, config.base, config.paths.clean) );

    /*--------------
        CSS URLs
    ---------------*/

    // determine asset paths in css by finding relative path between themes and output
    // force forward slashes

    config.paths.assets = {
      source       : '../../themes', // source asset path is always the same
      uncompressed : './' + path.relative(config.paths.output.uncompressed, config.paths.output.themes).replace(/\\/g, '/'),
      compressed   : './' + path.relative(config.paths.output.compressed, config.paths.output.themes).replace(/\\/g, '/'),
      packaged     : './' + path.relative(config.paths.output.packaged, config.paths.output.themes).replace(/\\/g, '/')
    };

    /*--------------
       Permission
    ---------------*/

    if(config.permission) {
      config.hasPermissions = true;
    }
    else {
      // pass blank object to avoid causing errors
      config.permission     = {};
      config.hasPermissions = false;
    }

    /*--------------
         Globs
    ---------------*/

    if(!config.globs) {
      config.globs = {};
    }

    // remove duplicates from component array
    if(config.components instanceof Array) {
      config.components = config.components.filter(function(component, index) {
        return config.components.indexOf(component) == index;
      });
    }

    // takes component object and creates file glob matching selected components
    config.globs.components = (typeof config.components == 'object')
      ? (config.components.length > 1)
        ? '{' + config.components.join(',') + '}'
        : config.components[0]
      : '{' + defaults.components.join(',') + '}'
    ;

    return config;

  }
function ( config ) { config = config || extend ( false , { } , defaults ) ; /*--------------
       File Paths
    ---------------*/ var configPath = this . getPath ( ) , sourcePaths = { } , outputPaths = { } , folder ; // resolve paths (config location + base + path) for ( folder in config . paths . source ) { if ( config . paths . source . hasOwnProperty ( folder ) ) { sourcePaths [ folder ] = path . resolve ( path . join ( configPath , config . base , config . paths . source [ folder ] ) ) ; } } for ( folder in config . paths . output ) { if ( config . paths . output . hasOwnProperty ( folder ) ) { outputPaths [ folder ] = path . resolve ( path . join ( configPath , config . base , config . paths . output [ folder ] ) ) ; } } // set config paths to full paths config . paths . source = sourcePaths ; config . paths . output = outputPaths ; // resolve "clean" command path config . paths . clean = path . resolve ( path . join ( configPath , config . base , config . paths . clean ) ) ; /*--------------
        CSS URLs
    ---------------*/ // determine asset paths in css by finding relative path between themes and output // force forward slashes config . paths . assets = { source : '../../themes' , // source asset path is always the same uncompressed : './' + path . relative ( config . paths . output . uncompressed , config . paths . output . themes ) . replace ( / \\ / g , '/' ) , compressed : './' + path . relative ( config . paths . output . compressed , config . paths . output . themes ) . replace ( / \\ / g , '/' ) , packaged : './' + path . relative ( config . paths . output . packaged , config . paths . output . themes ) . replace ( / \\ / g , '/' ) } ; /*--------------
       Permission
    ---------------*/ if ( config . permission ) { config . hasPermissions = true ; } else { // pass blank object to avoid causing errors config . permission = { } ; config . hasPermissions = false ; } /*--------------
         Globs
    ---------------*/ if ( ! config . globs ) { config . globs = { } ; } // remove duplicates from component array if ( config . components instanceof Array ) { config . components = config . components . filter ( function ( component , index ) { return config . components . indexOf ( component ) == index ; } ) ; } // takes component object and creates file glob matching selected components config . globs . components = ( typeof config . components == 'object' ) ? ( config . components . length > 1 ) ? '{' + config . components . join ( ',' ) + '}' : config . components [ 0 ] : '{' + defaults . components . join ( ',' ) + '}' ; return config ; }
adds additional derived values to a config object
adds additional derived values to a config object