Changes

Jump to navigation Jump to search
m
no edit summary
Line 3: Line 3:     
function wbContainer( universe, location ) {
 
function wbContainer( universe, location ) {
 +
 +
Debug_switch = false;
    
this.main = interjson( checkdive( universe, location ));
 
this.main = interjson( checkdive( universe, location ));
Line 38: Line 40:  
})
 
})
 
}).then( function(result) {
 
}).then( function(result) {
console.log(result);
+
debuglog(result);
 
return result;
 
return result;
 
});
 
});
Line 75: Line 77:  
 
 
Object.keys(read).forEach( function(path) {
 
Object.keys(read).forEach( function(path) {
console.log("instructions are an object, in path " + path);
+
debuglog("instructions are an object, in path " + path);
    
//||||||||||||||||||||||||||[ Check if elements of instruction object are arrays themselves ]||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 
//||||||||||||||||||||||||||[ Check if elements of instruction object are arrays themselves ]||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Line 83: Line 85:  
Object.keys(read[path]).forEach( function( path2 ) {
 
Object.keys(read[path]).forEach( function( path2 ) {
   −
console.log("instructions are an array of arrays, going through " + read[ path ][ path2 ] );
+
debuglog("instructions are an array of arrays, going through " + read[ path ][ path2 ] );
 
 
 
if ( data_function( future_return_partition, read[ path ][ path2 ] ) != future_return_partition ){
 
if ( data_function( future_return_partition, read[ path ][ path2 ] ) != future_return_partition ){
Line 96: Line 98:  
if ( success_o_meter === true ) {
 
if ( success_o_meter === true ) {
 
// Put the result of the travel along the paths in array element of array into the future_instructional_return bunch
 
// Put the result of the travel along the paths in array element of array into the future_instructional_return bunch
console.log("arrived at")
+
debuglog("arrived at")
console.log(future_return_partition);
+
debuglog(future_return_partition);
 
future_instructional_return[path] = future_return_partition;
 
future_instructional_return[path] = future_return_partition;
 
} else {
 
} else {
console.log("seeking derailed");
+
debuglog("seeking derailed");
 
success_o_meter = true;
 
success_o_meter = true;
 
future_instructional_return[path] = undefined;
 
future_instructional_return[path] = undefined;
Line 169: Line 171:  
var future_temp_obj = [];
 
var future_temp_obj = [];
 
if ( Array.isArray( temp_obj ) ) {
 
if ( Array.isArray( temp_obj ) ) {
console.log("data is on an array level");
+
debuglog("data is on an array level");
 
Object.keys( temp_obj ).forEach( function ( ect ) {
 
Object.keys( temp_obj ).forEach( function ( ect ) {
 
 
 
// if we are on an array level in the data, lets iterate through the array
 
// if we are on an array level in the data, lets iterate through the array
 
 
console.log("Within partition: " + ect );
+
debuglog("Within partition: " + ect );
 
if ( checkdive( temp_obj[ ect ], moving ) !== undefined ) {
 
if ( checkdive( temp_obj[ ect ], moving ) !== undefined ) {
 
future_temp_obj.push( checkdive( temp_obj[ ect ], moving ) );
 
future_temp_obj.push( checkdive( temp_obj[ ect ], moving ) );
Line 186: Line 188:  
// if we are not on an array level, proceed with the path
 
// if we are not on an array level, proceed with the path
 
 
console.log("data is on an objective level");
+
debuglog("data is on an objective level");
 
 
 
if ( checkdive( temp_obj, moving ) !== temp_obj ) {
 
if ( checkdive( temp_obj, moving ) !== temp_obj ) {
Line 194: Line 196:  
temp_obj = future_temp_obj;
 
temp_obj = future_temp_obj;
 
} else {
 
} else {
console.log('nothing to see here')
+
debuglog('nothing to see here')
 
}
 
}
   Line 240: Line 242:  
} catch (e) {
 
} catch (e) {
 
// if not JSON, do silly things
 
// if not JSON, do silly things
console.log('not a json ¯\_(ツ)_/¯');
+
debuglog('not a json ¯\_(ツ)_/¯');
 
};
 
};
 
}  
 
}  
+
 
 +
function debuglog( l0g ){
 +
if ( Debug_switch ) {
 +
debuglog( l0g );
 +
}
 +
}
 
}
 
}
530

edits

Navigation menu