@shikijs/twoslash 1.5.1 → 1.6.0

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.
Files changed (2) hide show
  1. package/dist/core.mjs +3 -3
  2. 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][a-zA-Z0-9_]*(\<[^\>]*\>)?:/;
780
- const regexFunction = /^[a-zA-Z0-9_]*\(/;
779
+ const regexType = /^[A-Z]\w*(<[^>]*>)?:/;
780
+ const regexFunction = /^\w*\(/;
781
781
  function defaultHoverInfoProcessor(type) {
782
- let content = type.replace(/^\(([\w-]+?)\)\s+/mg, "").replace(/\nimport .*$/, "").replace(/^(interface|namespace) \w+$/mg, "").trim();
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.1",
4
+ "version": "1.6.0",
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.1"
53
+ "@shikijs/core": "1.6.0"
54
54
  },
55
55
  "devDependencies": {
56
- "@iconify-json/carbon": "^1.1.32",
57
- "@iconify-json/codicon": "^1.1.47",
56
+ "@iconify-json/carbon": "^1.1.33",
57
+ "@iconify-json/codicon": "^1.1.49",
58
58
  "@shikijs/twoslash": "^3.1.2",
59
59
  "hast-util-from-html": "^2.0.1",
60
60
  "typescript": "^5.4.5"