Skip to content

Commit ac6f740

Browse files
committed
Add JSDocs
1 parent 82ecc91 commit ac6f740

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

lib/bundle.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,7 @@ function handleLocalCollisions(trace, initialMainKeys) {
299299
* @param {string} commonPathFromData - The common path in the file's paths
300300
* @param {Array} allData - array of { path, content} objects
301301
* @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
302303
* @returns {object} - The references in current node and the new content from the node
303304
*/
304305
async function getReferences (currentNode, isOutOfRoot, pathSolver, parentFilename, version, rootMainKeys,
@@ -334,6 +335,12 @@ async function getReferences (currentNode, isOutOfRoot, pathSolver, parentFilena
334335

335336
remoteRefResolutionPromises.push(
336337
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+
*/
337344
function convertToJSONString (content) {
338345
if (typeof content === 'object') {
339346
return JSON.stringify(content);
@@ -534,6 +541,7 @@ async function getReferences (currentNode, isOutOfRoot, pathSolver, parentFilena
534541
* @param {object} rootMainKeys - A dictionary with the component keys in local components object and its mainKeys
535542
* @param {string} commonPathFromData - The common path in the file's paths
536543
* @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
537545
* @returns {object} - Detect root files result object
538546
*/
539547
async function getNodeContentAndReferences (currentNode, allData, specRoot, version, rootMainKeys,
@@ -665,6 +673,7 @@ function handleCircularReference(traverseContext, documentContext) {
665673
* @param {function} refTypeResolver - The resolver function to test if node has a reference
666674
* @param {object} components - The global components object
667675
* @param {string} version - The current version
676+
* @param {function} remoteRefResolver - The function that would be called to fetch remote ref contents
668677
* @returns {object} The components object related to the file
669678
*/
670679
function generateComponentsObject(documentContext, rootContent,
@@ -871,6 +880,7 @@ module.exports = {
871880
* @param {Array} allData - array of { path, content} objects
872881
* @param {Array} origin - process origin (BROWSER or node)
873882
* @param {string} version - The version we are using
883+
* @param {function} remoteRefResolver - The function that would be called to fetch remote ref contents
874884
* @returns {object} - Detect root files result object
875885
*/
876886
getBundleContentAndComponents: async function (specRoot, allData, origin, version, remoteRefResolver) {

lib/schemaUtils.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5267,6 +5267,7 @@ module.exports = {
52675267
* @param {string} format - the format required by the user
52685268
* @param {boolean} toBundle - if it will be used in bundle
52695269
* @param {object} options - a standard list of options that's globally passed around. Check options.js for more.
5270+
* @param {function} remoteRefResolver - The function that would be called to fetch remote ref contents
52705271
*
52715272
* @returns {object} root files information and data input
52725273
*/

0 commit comments

Comments
 (0)