@@ -299,6 +299,7 @@ function handleLocalCollisions(trace, initialMainKeys) {
299
299
* @param {string } commonPathFromData - The common path in the file's paths
300
300
* @param {Array } allData - array of { path, content} objects
301
301
* @param {object } globalReferences - The accumulated global references from all nodes
302
+ * @param {function } remoteRefResolver - The function that would be called to fetch remote ref contents
302
303
* @returns {object } - The references in current node and the new content from the node
303
304
*/
304
305
async function getReferences ( currentNode , isOutOfRoot , pathSolver , parentFilename , version , rootMainKeys ,
@@ -334,6 +335,12 @@ async function getReferences (currentNode, isOutOfRoot, pathSolver, parentFilena
334
335
335
336
remoteRefResolutionPromises . push (
336
337
new Promise ( async ( resolveInner ) => {
338
+
339
+ /**
340
+ * Converts contents received from remoteRefResolver into stringified JSON
341
+ * @param {string | object } content - contents from remoteRefResolver
342
+ * @returns Stringified JSON contents
343
+ */
337
344
function convertToJSONString ( content ) {
338
345
if ( typeof content === 'object' ) {
339
346
return JSON . stringify ( content ) ;
@@ -534,6 +541,7 @@ async function getReferences (currentNode, isOutOfRoot, pathSolver, parentFilena
534
541
* @param {object } rootMainKeys - A dictionary with the component keys in local components object and its mainKeys
535
542
* @param {string } commonPathFromData - The common path in the file's paths
536
543
* @param {object } globalReferences - The accumulated global refernces from all nodes
544
+ * @param {function } remoteRefResolver - The function that would be called to fetch remote ref contents
537
545
* @returns {object } - Detect root files result object
538
546
*/
539
547
async function getNodeContentAndReferences ( currentNode , allData , specRoot , version , rootMainKeys ,
@@ -665,6 +673,7 @@ function handleCircularReference(traverseContext, documentContext) {
665
673
* @param {function } refTypeResolver - The resolver function to test if node has a reference
666
674
* @param {object } components - The global components object
667
675
* @param {string } version - The current version
676
+ * @param {function } remoteRefResolver - The function that would be called to fetch remote ref contents
668
677
* @returns {object } The components object related to the file
669
678
*/
670
679
function generateComponentsObject ( documentContext , rootContent ,
@@ -871,6 +880,7 @@ module.exports = {
871
880
* @param {Array } allData - array of { path, content} objects
872
881
* @param {Array } origin - process origin (BROWSER or node)
873
882
* @param {string } version - The version we are using
883
+ * @param {function } remoteRefResolver - The function that would be called to fetch remote ref contents
874
884
* @returns {object } - Detect root files result object
875
885
*/
876
886
getBundleContentAndComponents : async function ( specRoot , allData , origin , version , remoteRefResolver ) {
0 commit comments