lib/jsdoc/transform-apijson-for-sdk.js
function extractSamplesFromDocuIndex(oChainObject) {
		// If we have not extracted docuPath we return early
		if (!oChainObject.docuPath) {
			return oChainObject;
		}
		return new Promise(function(oResolve) {
			// Join .library path with relative docuindex.json path
			let sPath = path.join(path.dirname(oChainObject.libraryFile), oChainObject.docuPath);
			// Normalize path to resolve relative path
			sPath = path.normalize(sPath);

			fs.readFile(sPath, 'utf8', (oError, oFileData) => {
				if (!oError) {
					oFileData = JSON.parse(oFileData);
					if (oFileData.explored && oFileData.explored.entities && oFileData.explored.entities.length > 0) {
						oChainObject.entitiesWithSamples = [];
						oFileData.explored.entities.forEach(oEntity => {
							oChainObject.entitiesWithSamples.push(oEntity.id);
						});
					}
				}
				// We aways resolve as this data is not mandatory
				oResolve(oChainObject);
			});

		});
	}
function extractSamplesFromDocuIndex(oChainObject) {
		// If we have not extracted docuPath we return early
		if (!oChainObject.docuPath) {
			return oChainObject;
		}
		return new Promise(function(oResolve) {
			// Join .library path with relative docuindex.json path
			let sPath = path.join(path.dirname(oChainObject.libraryFile), oChainObject.docuPath);
			// Normalize path to resolve relative path
			sPath = path.normalize(sPath);

			fs.readFile(sPath, 'utf8', (oError, oFileData) => {
				if (!oError) {
					oFileData = JSON.parse(oFileData);
					if (oFileData.explored && oFileData.explored.entities && oFileData.explored.entities.length > 0) {
						oChainObject.entitiesWithSamples = [];
						oFileData.explored.entities.forEach(oEntity => {
							oChainObject.entitiesWithSamples.push(oEntity.id);
						});
					}
				}
				// We aways resolve as this data is not mandatory
				oResolve(oChainObject);
			});

		});
	}
function extractSamplesFromDocuIndex ( oChainObject ) { // If we have not extracted docuPath we return early if ( ! oChainObject . docuPath ) { return oChainObject ; } return new Promise ( function ( oResolve ) { // Join .library path with relative docuindex.json path let sPath = path . join ( path . dirname ( oChainObject . libraryFile ) , oChainObject . docuPath ) ; // Normalize path to resolve relative path sPath = path . normalize ( sPath ) ; fs . readFile ( sPath , 'utf8' , ( oError , oFileData ) => { if ( ! oError ) { oFileData = JSON . parse ( oFileData ) ; if ( oFileData . explored && oFileData . explored . entities && oFileData . explored . entities . length > 0 ) { oChainObject . entitiesWithSamples = [ ] ; oFileData . explored . entities . forEach ( oEntity => { oChainObject . entitiesWithSamples . push ( oEntity . id ) ; } ) ; } } // We aways resolve as this data is not mandatory oResolve ( oChainObject ) ; } ) ; } ) ; }
Adds to the passed object array with entities which have explored samples
@param {object} oChainObject chain object
@returns {object} chain object
Adds to the passed object array with entities which have explored samples