@vuepress/shared 2.0.0-beta.45 → 2.0.0-beta.48

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/index.cjs CHANGED
@@ -127,11 +127,12 @@ var isLinkFtp = (link) => link.startsWith("ftp://");
127
127
  var isLinkHttp = (link) => /^(https?:)?\/\//.test(link);
128
128
 
129
129
  // src/utils/isLinkExternal.ts
130
+ var markdownLinkRegexp = /.md((\?|#).*)?$/;
130
131
  var isLinkExternal = (link, base = "/") => {
131
132
  if (isLinkHttp(link) || isLinkFtp(link)) {
132
133
  return true;
133
134
  }
134
- if (link.startsWith("/") && !link.startsWith(base) && !link.endsWith(".md")) {
135
+ if (link.startsWith("/") && !link.startsWith(base) && !markdownLinkRegexp.test(link)) {
135
136
  return true;
136
137
  }
137
138
  return false;
package/dist/index.d.ts CHANGED
@@ -35,7 +35,7 @@ declare type LocaleConfig<T extends LocaleData = LocaleData> = Record<string, Pa
35
35
  /**
36
36
  * Locales data
37
37
  */
38
- declare type LocaleData = Record<string, any>;
38
+ declare type LocaleData = Record<never, never>;
39
39
 
40
40
  /**
41
41
  * Base type of vuepress page
@@ -98,7 +98,7 @@ declare type PageFrontmatter<T extends Record<any, any> = Record<string, unknown
98
98
  lang?: string;
99
99
  layout?: string;
100
100
  permalink?: string;
101
- permalinkPattern?: string;
101
+ permalinkPattern?: string | null;
102
102
  routeMeta?: Record<string, unknown>;
103
103
  title?: string;
104
104
  };
package/dist/index.js CHANGED
@@ -83,11 +83,12 @@ var isLinkFtp = (link) => link.startsWith("ftp://");
83
83
  var isLinkHttp = (link) => /^(https?:)?\/\//.test(link);
84
84
 
85
85
  // src/utils/isLinkExternal.ts
86
+ var markdownLinkRegexp = /.md((\?|#).*)?$/;
86
87
  var isLinkExternal = (link, base = "/") => {
87
88
  if (isLinkHttp(link) || isLinkFtp(link)) {
88
89
  return true;
89
90
  }
90
- if (link.startsWith("/") && !link.startsWith(base) && !link.endsWith(".md")) {
91
+ if (link.startsWith("/") && !link.startsWith(base) && !markdownLinkRegexp.test(link)) {
91
92
  return true;
92
93
  }
93
94
  return false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vuepress/shared",
3
- "version": "2.0.0-beta.45",
3
+ "version": "2.0.0-beta.48",
4
4
  "description": "Utils that shared between VuePress node and client",
5
5
  "keywords": [
6
6
  "vuepress",
@@ -32,7 +32,7 @@
32
32
  "dist"
33
33
  ],
34
34
  "dependencies": {
35
- "@vue/shared": "^3.2.33"
35
+ "@vue/shared": "^3.2.36"
36
36
  },
37
37
  "publishConfig": {
38
38
  "access": "public"