Skip to content

Commit

Permalink
Fixed jsdocs to gen right for init
Browse files Browse the repository at this point in the history
  • Loading branch information
Phara0h committed Sep 22, 2020
1 parent 6ddc239 commit ed4dedd
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -405,10 +405,10 @@ jsFile += `
* init
* \`\`\`js
* import sdk from './sdk.mjs';
* const ${setClassName(collection.info.name, collection.info)} = sdk('http://127.0.0.1');
* const ${setClassName(collection.info.name)} = sdk('http://127.0.0.1');
* \`\`\`
*/
export default function(host, opts){
function SDK (host, opts){
if(host) {
hostUrl = host;
}
Expand All @@ -417,17 +417,18 @@ jsFile += `
}
return {${allNewClasses.join()}};
}
export default SDK;
`
}
else {
jsFile += `
* @example
* init
* \`\`\`js
* const { ${setClassName(collection.info.name, collection.info)} } = require('./sdk.js')('http://127.0.0.1');
* const { ${setClassName(collection.info.name)} } = require('./sdk.js')('http://127.0.0.1');
* \`\`\`
*/
module.exports= function(host, opts){
function SDK (host, opts){
if(host) {
hostUrl = host;
}
Expand All @@ -436,6 +437,7 @@ jsFile += `
}
return {${allNewClasses.join()}};
}
module.exports = SDK;
`
}

Expand Down

0 comments on commit ed4dedd

Please sign in to comment.