Line 1: |
Line 1: |
− |
| |
| // License: GPL | | // License: GPL |
| // Wikibase Processor | | // Wikibase Processor |
Line 8: |
Line 7: |
| var the = this.main; | | var the = this.main; |
| | | |
| + | /* The following is the main exposed function of the current Wb Processing class |
| + | usage cases |
| + | |
| + | to check the last value in a location given by a preceding array of internal paths to find, with the possibility of array layers between elements of array of paths: |
| + | wbproc.checkentity( [ wbEStruct['instanceOfRelations'], wbEStruct['IDPropLoc'], wbEStruct['IDName'], 96 ] ); |
| + | |
| + | */ |
| + | |
| this.checkentity = function ( paths ) { | | this.checkentity = function ( paths ) { |
| if ( ( the !== undefined ) && ( paths !== undefined ) ){ | | if ( ( the !== undefined ) && ( paths !== undefined ) ){ |
Line 85: |
Line 92: |
| future_instructional_return.push( data_function( temp_obj, read[ path ] ) ); | | future_instructional_return.push( data_function( temp_obj, read[ path ] ) ); |
| } else { | | } else { |
− | future_instructional_return.push( undefined ); | + | // future_instructional_return.push( undefined ); |
| } | | } |
| | | |
Line 125: |
Line 132: |
| } | | } |
| } | | } |
| + | // If we haven't got a not found signal along the way, let's try returning the object |
| + | |
| if ( success_o_meter === true ) { | | if ( success_o_meter === true ) { |
| return temp_obj; | | return temp_obj; |
Line 143: |
Line 152: |
| | | |
| console.log("Within partition: " + ect ); | | console.log("Within partition: " + ect ); |
− | future_temp_obj.push( checkdive( temp_obj[ ect ], moving ) ); | + | if ( checkdive( temp_obj[ ect ], moving ) !== undefined ) { |
| + | future_temp_obj.push( checkdive( temp_obj[ ect ], moving ) ); |
| + | } |
| | | |
| }); | | }); |
Line 153: |
Line 164: |
| | | |
| console.log("data is on an objective level"); | | console.log("data is on an objective level"); |
− | future_temp_obj = checkdive( temp_obj, moving ); | + | |
| + | if ( checkdive( temp_obj, moving ) !== temp_obj ) { |
| + | future_temp_obj = checkdive( temp_obj, moving ); |
| + | } |
| if ( future_temp_obj !== undefined ){ | | if ( future_temp_obj !== undefined ){ |
| temp_obj = future_temp_obj; | | temp_obj = future_temp_obj; |
Line 167: |
Line 181: |
| //|||||||||||||||||||||||||||||||||||||||||||||||||||||[ E N D O F S T E P B L O C K ]||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| | | //|||||||||||||||||||||||||||||||||||||||||||||||||||||[ E N D O F S T E P B L O C K ]||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| |
| | | |
− | function checkdive( array, read){ | + | wbContainer.prototype.xcontains = function ( unv, angle ) { |
| + | return proceed( unv, angle ); |
| + | } |
| + | |
| + | function checkdive( array, read ){ |
| if ( check(array, read) !== undefined) { | | if ( check(array, read) !== undefined) { |
| return dive(array, read); | | return dive(array, read); |
− | } else if ( Array.isArray(array) ) { | + | } |
| + | if ( Array.isArray(array) ) { |
| var potential_return = []; | | var potential_return = []; |
| Object.keys(array).forEach( function(item){ | | Object.keys(array).forEach( function(item){ |
Line 182: |
Line 201: |
| return read; | | return read; |
| } | | } |
| + | /* |
| if (Object.keys( array ).length > 0 ){ | | if (Object.keys( array ).length > 0 ){ |
| Object.keys( array ).forEach( function ( piece ) { | | Object.keys( array ).forEach( function ( piece ) { |
Line 187: |
Line 207: |
| }); | | }); |
| } | | } |
| + | */ |
| } | | } |
| | | |
Line 196: |
Line 217: |
| console.log('not a json ¯\_(ツ)_/¯'); | | console.log('not a json ¯\_(ツ)_/¯'); |
| }; | | }; |
− | } | + | } |
− |
| |
− | }
| |