mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
chore(cloudcmd) lint
This commit is contained in:
parent
d473a7e187
commit
794caced01
15 changed files with 42 additions and 35 deletions
|
|
@ -39,7 +39,7 @@ const isDev = process.env.NODE_ENV === 'development';
|
|||
const getDist = (isDev) => isDev ? 'dist-dev' : 'dist';
|
||||
|
||||
const getIndexPath = (isDev) => path.join(DIR, '..', `${getDist(isDev)}/index.html`);
|
||||
const defaultHtml = fs.readFileSync(getIndexPath(isDev), 'utf8');
|
||||
const html = fs.readFileSync(getIndexPath(isDev), 'utf8');
|
||||
|
||||
const initAuth = currify(_initAuth);
|
||||
const notEmpty = (a) => a;
|
||||
|
|
@ -249,7 +249,7 @@ function cloudcmd({modules, config}) {
|
|||
|
||||
rest(config),
|
||||
route(config, {
|
||||
html: defaultHtml,
|
||||
html,
|
||||
}),
|
||||
|
||||
ponseStatic,
|
||||
|
|
|
|||
|
|
@ -169,9 +169,9 @@ function indexProcessing(config, options) {
|
|||
return data;
|
||||
}
|
||||
|
||||
function buildIndex(config, html, json) {
|
||||
function buildIndex(config, html, data) {
|
||||
const panel = CloudFunc.buildFromJSON({
|
||||
data: json,
|
||||
data,
|
||||
prefix: getPrefix(config),
|
||||
template: Template,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ module.exports = currify(async({menuName}, req, res, next) => {
|
|||
const {method} = req;
|
||||
|
||||
if (method === 'GET')
|
||||
return onGET({
|
||||
return await onGET({
|
||||
req,
|
||||
res,
|
||||
menuName,
|
||||
|
|
@ -76,10 +76,10 @@ async function onGET({req, res, menuName}) {
|
|||
.send(result.code);
|
||||
}
|
||||
|
||||
function getError(parseError, source) {
|
||||
function getError(error, source) {
|
||||
return `
|
||||
const e = Error(\`<pre>${codeframe({
|
||||
error: parseError,
|
||||
error,
|
||||
source,
|
||||
highlightCode: false,
|
||||
})}</pre>\`);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue