Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

format the log content to keep the original chalk color tag and fix typo #13

Merged
merged 3 commits into from
Oct 9, 2023

Conversation

NingW101
Copy link
Contributor

@NingW101 NingW101 commented Oct 7, 2023

src/server.ts Outdated
@@ -1144,7 +1144,8 @@ async function startServer() {
try {
const data = matchedData(req);
const content = API.getBuildLog(data.root);
res.status(200).json({ content });
// eslint-disable-next-line no-control-regex
res.status(200).json({ content: content.replace(/\u001b/g, "\\u001b") });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can move the .replace call to const content = API.getBuildLog(data.root).replace(/\u001b/g, "\\u001b");

Copy link
Contributor

@lingyuncai lingyuncai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks Ning!

@NingW101 NingW101 merged commit 219b8ce into web-devkits:main Oct 9, 2023
2 checks passed
@NingW101 NingW101 deleted the bug-fix branch November 20, 2023 05:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants