Skip to content

Commit

Permalink
fix: type signature is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
ankitskvmdam committed Dec 29, 2022
1 parent 5eb70b7 commit 94bf260
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ function needsSignature({ kind, type, meta }) {

// typedefs that contain functions get a signature, too
else if (kind === 'typedef' && type && type.names && type.names.length) {
for (var i = 0, l = type.names.length; i < l; i++) {
for (let i = 0, l = type.names.length; i < l; i++) {
if (type.names[i].toLowerCase() === 'function') {
needsSig = true;
break;
Expand Down Expand Up @@ -179,7 +179,7 @@ function buildAttribsString(attribs) {
let attribsString = '';

if (attribs && attribs.length) {
htmlsafe(`(${attribs.join(', ')}) `);
attribsString = htmlsafe(`(${attribs.join(', ')}) `);
}

return attribsString;
Expand Down Expand Up @@ -232,7 +232,8 @@ function addSignatureReturns(f) {
)}}`;
}

var signatureOutput = '';

let signatureOutput = '';

if (f.signature) {
signatureOutput =
Expand All @@ -244,6 +245,7 @@ function addSignatureReturns(f) {
}

f.signature = signatureOutput;

}

function addSignatureTypes(f) {
Expand Down Expand Up @@ -409,7 +411,7 @@ function buildSidebarMembers({
children: [],
};

var methods =
const methods =
sectionName === SECTION_TYPE.Tutorials ||
sectionName === SECTION_TYPE.Global
? []
Expand Down Expand Up @@ -444,11 +446,11 @@ function buildSidebarMembers({

currentItem.children.push(itemChild);

var name = method.longname.split(
let name = method.longname.split(
method.scope === 'static' ? '.' : '#'
);
var first = name[0];
var last = name[1];
const first = name[0];
const last = name[1];

name = first + ' &rtrif; ' + last;

Expand Down Expand Up @@ -510,11 +512,11 @@ function buildNavbar() {
* @return {string} The HTML for the navigation sidebar.
*/
function buildSidebar(members) {
var title = themeOpts.title || 'Home';
const title = themeOpts.title || 'Home';

var isHTML = RegExp.prototype.test.bind(/(<([^>]+)>)/i);
const isHTML = RegExp.prototype.test.bind(/(<([^>]+)>)/i);

var nav = {
const nav = {
sections: [],
};

Expand All @@ -530,13 +532,13 @@ function buildSidebar(members) {
};
}

var seen = {};
var seenTutorials = {};
var seenGlobal = {};
const seen = {};
const seenTutorials = {};
const seenGlobal = {};

var sectionsOrder = themeOpts.sections || defaultSections;
const sectionsOrder = themeOpts.sections || defaultSections;

var sections = {
const sections = {
[SECTION_TYPE.Modules]: buildSidebarMembers({
itemHeading: 'Modules',
items: members.modules,
Expand Down Expand Up @@ -614,7 +616,7 @@ function buildSidebar(members) {
if (SECTION_TYPE[section] !== undefined) {
nav.sections.push(sections[section]);
} else {
var errorMsg = `While building nav. Section name: ${section} is not recognized.
const errorMsg = `While building nav. Section name: ${section} is not recognized.
Accepted sections are: ${defaultSections.join(', ')}
`;

Expand Down

0 comments on commit 94bf260

Please sign in to comment.