Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (param.default) {
return param.name + " = " + param.default;
}
return param.name + "?";
}
return param.name;
}
if (param.type && param.type.name)
return param.name + ": " + param.type.name.replace(/\n/g, "");
return param.name;
}
// Read package.json to get API version number
const pkg = require("moleculer/package.json");
const apiVersion = semver.major(pkg.version) + "." + semver.minor(pkg.version);
console.log("API version:", apiVersion);
// Source files for API docs
const sourceFiles = [
{ path: "service-broker.js", name: "ServiceBroker" },
{ path: "service.js", name: "Service" },
{ path: "context.js", name: "Context" }
]
// Target folder
const targetFolder = path.join(".", "source", "docs", apiVersion, "api");
console.log("Target folder:", targetFolder);
mkdir(targetFolder);
// Template
const templateFolder = path.join(__dirname, "api-template", "md");
}
return param.name;
}
if (param.type && param.type.name)
return param.name + ": " + param.type.name.replace(/\n/g, "");
return param.name;
}
function codeHighlight(code) {
return "<pre class="hljs">" + hljs.highlightAuto(code, "js") + "</pre>";
}
const pkg = require("moleculer/package.json");
const apiVersion = semver.major(pkg.version) + "." + semver.minor(pkg.version);
console.log("API version:", apiVersion);
const sourceFiles = [
{ path: "service-broker.js", name: "ServiceBroker" },
{ path: "service.js", name: "Service" },
{ path: "context.js", name: "Context" }
]
const targetFolder = path.join(".", "source", "api-" + apiVersion);
console.log("Target folder:", targetFolder);
mkdir(targetFolder);
Promise.each(sourceFiles, sourceFile => {