lib/jsdoc/transform-apijson-for-sdk.js
function preProcessSymbols(symbols) {
			// Create treeName and modify module names
			symbols.forEach(oSymbol => {
				let sModuleClearName = oSymbol.name.replace(/^module:/, "");
				oSymbol.displayName = sModuleClearName;
				oSymbol.treeName = sModuleClearName.replace(/\//g, ".");
			});

			// Create missing - virtual namespaces
			symbols.forEach(oSymbol => {
				oSymbol.treeName.split(".").forEach((sPart, i, a) => {
					let sName = a.slice(0, (i + 1)).join(".");

					if (!symbols.find(o => o.treeName === sName)) {
						symbols.push({
							name: sName,
							displayName: sName,
							treeName: sName,
							lib: oSymbol.lib,
							kind: "namespace"
						});
					}
				});
			});

			// Discover parents
			symbols.forEach(oSymbol => {
				let aParent = oSymbol.treeName.split("."),
					sParent;

				// Extract parent name
				aParent.pop();
				sParent = aParent.join(".");

				// Mark parent
				if (symbols.find(({treeName}) => treeName === sParent)) {
					oSymbol.parent = sParent;
				}
			});

			// Attach children info
			symbols.forEach(oSymbol => {
				if (oSymbol.parent) {
					let oParent = symbols.find(({treeName}) => treeName === oSymbol.parent);

					if (!oParent.nodes) oParent.nodes = [];
					oParent.nodes.push({
						name: oSymbol.displayName,
						description: formatters._preProcessLinksInTextBlock(oSymbol.description),
						href: "#/api/" + encodeURIComponent(oSymbol.name)
					});
				}
			});

			// Clean list - keep file size down
			symbols.forEach(o => {
				delete o.treeName;
				delete o.parent;
			});
		}
function preProcessSymbols(symbols) {
			// Create treeName and modify module names
			symbols.forEach(oSymbol => {
				let sModuleClearName = oSymbol.name.replace(/^module:/, "");
				oSymbol.displayName = sModuleClearName;
				oSymbol.treeName = sModuleClearName.replace(/\//g, ".");
			});

			// Create missing - virtual namespaces
			symbols.forEach(oSymbol => {
				oSymbol.treeName.split(".").forEach((sPart, i, a) => {
					let sName = a.slice(0, (i + 1)).join(".");

					if (!symbols.find(o => o.treeName === sName)) {
						symbols.push({
							name: sName,
							displayName: sName,
							treeName: sName,
							lib: oSymbol.lib,
							kind: "namespace"
						});
					}
				});
			});

			// Discover parents
			symbols.forEach(oSymbol => {
				let aParent = oSymbol.treeName.split("."),
					sParent;

				// Extract parent name
				aParent.pop();
				sParent = aParent.join(".");

				// Mark parent
				if (symbols.find(({treeName}) => treeName === sParent)) {
					oSymbol.parent = sParent;
				}
			});

			// Attach children info
			symbols.forEach(oSymbol => {
				if (oSymbol.parent) {
					let oParent = symbols.find(({treeName}) => treeName === oSymbol.parent);

					if (!oParent.nodes) oParent.nodes = [];
					oParent.nodes.push({
						name: oSymbol.displayName,
						description: formatters._preProcessLinksInTextBlock(oSymbol.description),
						href: "#/api/" + encodeURIComponent(oSymbol.name)
					});
				}
			});

			// Clean list - keep file size down
			symbols.forEach(o => {
				delete o.treeName;
				delete o.parent;
			});
		}
function preProcessSymbols ( symbols ) { // Create treeName and modify module names symbols . forEach ( oSymbol => { let sModuleClearName = oSymbol . name . replace ( / ^module: / , "" ) ; oSymbol . displayName = sModuleClearName ; oSymbol . treeName = sModuleClearName . replace ( / \/ / g , "." ) ; } ) ; // Create missing - virtual namespaces symbols . forEach ( oSymbol => { oSymbol . treeName . split ( "." ) . forEach ( ( sPart , i , a ) => { let sName = a . slice ( 0 , ( i + 1 ) ) . join ( "." ) ; if ( ! symbols . find ( o => o . treeName === sName ) ) { symbols . push ( { name : sName , displayName : sName , treeName : sName , lib : oSymbol . lib , kind : "namespace" } ) ; } } ) ; } ) ; // Discover parents symbols . forEach ( oSymbol => { let aParent = oSymbol . treeName . split ( "." ) , sParent ; // Extract parent name aParent . pop ( ) ; sParent = aParent . join ( "." ) ; // Mark parent if ( symbols . find ( ( { treeName } ) => treeName === sParent ) ) { oSymbol . parent = sParent ; } } ) ; // Attach children info symbols . forEach ( oSymbol => { if ( oSymbol . parent ) { let oParent = symbols . find ( ( { treeName } ) => treeName === oSymbol . parent ) ; if ( ! oParent . nodes ) oParent . nodes = [ ] ; oParent . nodes . push ( { name : oSymbol . displayName , description : formatters . _preProcessLinksInTextBlock ( oSymbol . description ) , href : "#/api/" + encodeURIComponent ( oSymbol . name ) } ) ; } } ) ; // Clean list - keep file size down symbols . forEach ( o => { delete o . treeName ; delete o . parent ; } ) ; }
Pre-processes the symbols list - creating virtual namespace records and attaching children list to namespace
records.
@param {object} symbols list
Pre - processes the symbols list - creating virtual namespace records and attaching children list to namespace records .