Skip to content

Commit e526a7f

Browse files
committed
chore: update highlight function
1 parent ff19045 commit e526a7f

File tree

6 files changed

+12
-13
lines changed

6 files changed

+12
-13
lines changed

dist/npm-to-yarn.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -693,16 +693,16 @@ function convert(str, to) {
693693
function highlight(command, theme) {
694694
if (theme === void 0) { theme = 'light'; }
695695
return __awaiter(this, void 0, void 0, function () {
696-
var html;
697696
return __generator(this, function (_a) {
698697
switch (_a.label) {
699698
case 0: return [4 /*yield*/, codeToHtml(command, {
700699
lang: 'shell',
701700
theme: "github-".concat(theme)
701+
}).then(function (html) {
702+
console.log(html);
702703
})];
703704
case 1:
704-
html = _a.sent();
705-
console.log(html);
705+
_a.sent();
706706
return [2 /*return*/];
707707
}
708708
});

dist/npm-to-yarn.mjs.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/npm-to-yarn.umd.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/npm-to-yarn.umd.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/types/highlight.d.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { npmToYarn } from './npmToYarn'
33
import { npmToPnpm } from './npmToPnpm'
44
import { npmToBun } from './npmToBun'
55

6-
import {codeToHtml} from 'shiki';
6+
import { codeToHtml } from 'shiki'
77

88
/**
99
* Converts between npm and yarn command
@@ -24,10 +24,10 @@ export function convert (str: string, to: 'npm' | 'yarn' | 'pnpm' | 'bun'): stri
2424
* Returns highlighted html string
2525
*/
2626
export async function highlight (command: string, theme: 'light' | 'dark' = 'light') {
27-
const html = await codeToHtml(command, {
27+
await codeToHtml(command, {
2828
lang: 'shell',
2929
theme: `github-${theme}`
30+
}).then((html) => {
31+
console.log(html)
3032
})
31-
32-
console.log(html)
3333
}

0 commit comments

Comments
 (0)