Skip to content
This repository has been archived by the owner on Oct 30, 2018. It is now read-only.

Commit

Permalink
whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
Isao Yagi committed Apr 26, 2012
1 parent 733f04d commit 2935d79
Showing 1 changed file with 61 additions and 60 deletions.
121 changes: 61 additions & 60 deletions source/lib/libs/ycb.js
Expand Up @@ -4,7 +4,7 @@
* See the accompanying LICENSE file for terms.
*/


module.exports = {

version: '2.0.0',
Expand All @@ -14,16 +14,16 @@ module.exports = {
SUBMATCH: /\$\$[a-zA-Z0-9.-_]*\$\$/,

/*
* Processes an Object representing a YCB 2.0 Bundle as defined in the spec.
*
*
* @method read
* @param {object} bundle
* @param {object} context
* @param {boolean} validate
* @param {boolean} debug
* @return {object}
*/
* Processes an Object representing a YCB 2.0 Bundle as defined in the spec.
*
*
* @method read
* @param {object} bundle
* @param {object} context
* @param {boolean} validate
* @param {boolean} debug
* @return {object}
*/
read: function(bundle, context, validate, debug){

var rawConfig, lookupPaths,
Expand Down Expand Up @@ -63,16 +63,16 @@ module.exports = {
},

/*
* This is a first pass at hairball of a funciton.
*
*
* @private
* @method _applySubstitutions
* @param {object} config
* @param {object} base
* @param {object} parent
* @return void
*/
* This is a first pass at hairball of a funciton.
*
*
* @private
* @method _applySubstitutions
* @param {object} config
* @param {object} base
* @param {object} parent
* @return void
*/
_applySubstitutions: function(config, base, parent){

var key, sub, find, item;
Expand Down Expand Up @@ -154,11 +154,11 @@ module.exports = {
},

/*
* @private
* @method _processRawBundle
* @param {object} bundle
* @return {object}
*/
* @private
* @method _processRawBundle
* @param {object} bundle
* @return {object}
*/
_processRawBundle: function(bundle){

var pos,
Expand All @@ -177,7 +177,7 @@ module.exports = {
}
else if(bundle[pos].settings){
context = {};

for(part=0; part<bundle[pos].settings.length; part++){
kv = bundle[pos].settings[part].split(':');
context[kv[0]] = kv[1];
Expand All @@ -189,6 +189,7 @@ module.exports = {
key = this._getLookupPath(dimensions, context);

// Add the section to the settings list with it's full key
// IMY Bug 5439377 configuration does not accept neither null nor false values?
if(!settings[key]){
settings[key] = bundle[pos];
}
Expand All @@ -206,12 +207,12 @@ module.exports = {
},

/*
* @private
* @method _getContextPath
* @param {object} dimensions A YCB dimension structured object
* @param {object} context Key/Value list
* @result {string}
*/
* @private
* @method _getContextPath
* @param {object} dimensions A YCB dimension structured object
* @param {object} context Key/Value list
* @result {string}
*/
_getLookupPaths: function(dimensions, context){

var lookupList = objectToList(this._makeOrderedLookupList(dimensions, context)),
Expand All @@ -228,7 +229,7 @@ module.exports = {
}

function tumble(combination, location){

// If the location is not found return
if(!combination[location]){
return false;
Expand All @@ -250,7 +251,7 @@ module.exports = {

do{
path = [];

for(pos=0; pos<lookupList.length; pos++){
path.push(lookupList[pos][combination[pos].current]);
}
Expand All @@ -263,12 +264,12 @@ module.exports = {
},

/*
* @private
* @method _getContextPath
* @param {object} dimensions A YCB dimension structured object
* @param {object} context Key/Value list
* @result {string}
*/
* @private
* @method _getContextPath
* @param {object} dimensions A YCB dimension structured object
* @param {object} context Key/Value list
* @result {string}
*/
_getLookupPath: function(dimensions, context){

var lookupList = this._makeOrderedLookupList(dimensions, context),
Expand Down Expand Up @@ -302,12 +303,12 @@ module.exports = {
},

/*
* @private
* @method _makeOrderedLookupList
* @param {object} dimensions A YCB dimension structured object
* @param {object} context Key/Value list
* @result {object} list of lists
*/
* @private
* @method _makeOrderedLookupList
* @param {object} dimensions A YCB dimension structured object
* @param {object} context Key/Value list
* @result {object} list of lists
*/
_makeOrderedLookupList: function(dimensions, context){

var dimensionPaths = this._flattenDimensions(dimensions),
Expand Down Expand Up @@ -343,11 +344,11 @@ module.exports = {
},

/*
* @private
* @method _flattenDimensions
* @param {object} dimensions A YCB dimension structured object
* @result {object} k/v map
*/
* @private
* @method _flattenDimensions
* @param {object} dimensions A YCB dimension structured object
* @result {object} k/v map
*/
_flattenDimensions: function(dimensions){

var dimensionPaths = {},
Expand All @@ -365,13 +366,13 @@ module.exports = {
},

/*
* @private
* @method _flattenDimension
* @param {string} prefix
* @param {object} dimension A single YCB dimension structured object
* @param {string} build
* @result {object} k/v map
*/
* @private
* @method _flattenDimension
* @param {string} prefix
* @param {object} dimension A single YCB dimension structured object
* @param {string} build
* @result {object} k/v map
*/
_flattenDimension: function(prefix, dimension, build){

var key, newPrefix, nextDimension;
Expand Down Expand Up @@ -407,7 +408,7 @@ function reverseList(from){
while(pos){
to.push(from[--pos]);
}

return to;
}

Expand Down

0 comments on commit 2935d79

Please sign in to comment.