@rspress/shared 1.7.4 → 1.8.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.
package/dist/index.d.ts CHANGED
@@ -685,7 +685,7 @@ declare function removeLeadingSlash(url: string): string;
685
685
  declare function addTrailingSlash(url: string): string;
686
686
  declare function removeTrailingSlash(url: string): string;
687
687
  declare function normalizeSlash(url: string): string;
688
- declare function isExternalUrl(url: string): boolean;
688
+ declare function isExternalUrl(url?: string): boolean;
689
689
  declare function replaceLang(rawUrl: string, lang: {
690
690
  current: string;
691
691
  target: string;
package/dist/index.js CHANGED
@@ -1183,7 +1183,7 @@ function removeTrailingSlash(url) {
1183
1183
  function normalizeSlash(url) {
1184
1184
  return removeTrailingSlash(addLeadingSlash(normalizePosixPath(url)));
1185
1185
  }
1186
- function isExternalUrl(url) {
1186
+ function isExternalUrl(url = "") {
1187
1187
  return url.startsWith("http://") || url.startsWith("https://") || url.startsWith("mailto:") || url.startsWith("tel:");
1188
1188
  }
1189
1189
  function replaceLang(rawUrl, lang, version, base = "") {
package/dist/index.mjs CHANGED
@@ -1126,7 +1126,7 @@ function removeTrailingSlash(url) {
1126
1126
  function normalizeSlash(url) {
1127
1127
  return removeTrailingSlash(addLeadingSlash(normalizePosixPath(url)));
1128
1128
  }
1129
- function isExternalUrl(url) {
1129
+ function isExternalUrl(url = "") {
1130
1130
  return url.startsWith("http://") || url.startsWith("https://") || url.startsWith("mailto:") || url.startsWith("tel:");
1131
1131
  }
1132
1132
  function replaceLang(rawUrl, lang, version, base = "") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspress/shared",
3
- "version": "1.7.4",
3
+ "version": "1.8.0",
4
4
  "types": "./dist/index.d.ts",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -47,6 +47,7 @@
47
47
  "provenance": true,
48
48
  "registry": "https://registry.npmjs.org/"
49
49
  },
50
+ "license": "MIT",
50
51
  "files": [
51
52
  "bin",
52
53
  "dist"