@shikijs/twoslash 1.5.0 → 1.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core.mjs +3 -3
- package/package.json +4 -4
package/dist/core.mjs
CHANGED
|
@@ -776,10 +776,10 @@ function rendererRich(options = {}) {
|
|
|
776
776
|
}
|
|
777
777
|
};
|
|
778
778
|
}
|
|
779
|
-
const regexType = /^[A-Z]
|
|
780
|
-
const regexFunction =
|
|
779
|
+
const regexType = /^[A-Z]\w*(<[^>]*>)?:/;
|
|
780
|
+
const regexFunction = /^\w*\(/;
|
|
781
781
|
function defaultHoverInfoProcessor(type) {
|
|
782
|
-
let content = type.replace(/^\(([\w-]
|
|
782
|
+
let content = type.replace(/^\(([\w-]+)\)\s+/gm, "").replace(/\nimport .*$/, "").replace(/^(interface|namespace) \w+$/gm, "").trim();
|
|
783
783
|
if (content.match(regexType))
|
|
784
784
|
content = `type ${content}`;
|
|
785
785
|
else if (content.match(regexFunction))
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shikijs/twoslash",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.5.
|
|
4
|
+
"version": "1.5.2",
|
|
5
5
|
"description": "Shiki transformer for twoslash",
|
|
6
6
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -50,11 +50,11 @@
|
|
|
50
50
|
],
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"twoslash": "^0.2.6",
|
|
53
|
-
"@shikijs/core": "1.5.
|
|
53
|
+
"@shikijs/core": "1.5.2"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@iconify-json/carbon": "^1.1.
|
|
57
|
-
"@iconify-json/codicon": "^1.1.
|
|
56
|
+
"@iconify-json/carbon": "^1.1.33",
|
|
57
|
+
"@iconify-json/codicon": "^1.1.48",
|
|
58
58
|
"@shikijs/twoslash": "^3.1.2",
|
|
59
59
|
"hast-util-from-html": "^2.0.1",
|
|
60
60
|
"typescript": "^5.4.5"
|