@rspress/shared 0.0.0-nightly-20231108160202 → 0.0.0-nightly-20231109160316

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
@@ -672,6 +672,7 @@ declare const isProduction: () => boolean;
672
672
  declare const isDebugMode: () => boolean;
673
673
  declare const cleanUrl: (url: string) => string;
674
674
  declare function slash(str: string): string;
675
+ declare function removeHash(str: string): string;
675
676
  declare function normalizePosixPath(id: string): string;
676
677
  declare const inBrowser: () => boolean;
677
678
  declare function addLeadingSlash(url: string): string;
@@ -708,4 +709,4 @@ declare function removeBase(url: string, base: string): string;
708
709
  declare function withoutHash(url: string): string;
709
710
  declare const mergeDocConfig: (...configs: UserConfig[]) => UserConfig;
710
711
 
711
- export { APPEARANCE_KEY, AdditionalPage, BaseRuntimePageInfo, Config, Config$1 as DefaultThemeConfig, DocFooter, EditLink, Feature, Footer, FrontMatterMeta, HASH_REGEXP, Header, Hero, Image, LocalSearchOptions, Locale, LocaleConfig, LocaleLink, LocaleLinks, MDX_REGEXP, MarkdownOptions, Nav, NavItem, NavItemWithChildren, NavItemWithLink, NavItemWithLinkAndChildren, NormalizedConfig, NormalizedConfig as NormalizedDefaultThemeConfig, NormalizedLocales, NormalizedSidebar, NormalizedSidebarGroup, PageData, PageIndexInfo, PageModule, PageType, RspressPlugin as Plugin, QUERY_REGEXP, RSPRESS_TEMP_DIR, RemotePageInfo, RemoteSearchIndexInfo, RemoteSearchOptions, ReplaceRule, Route, RouteMeta, RouteOptions, RspressPlugin, SEARCH_INDEX_NAME, SearchHooks, SearchOptions, Sidebar, SidebarDivider, SidebarGroup, SidebarItem, SiteData, SocialLink, SocialLinkIcon, UserConfig, addLeadingSlash, addTrailingSlash, cleanUrl, inBrowser, isDebugMode, isExternalUrl, isProduction, isSCM, mergeDocConfig, normalizeHref, normalizePosixPath, normalizeSlash, omit, parseUrl, removeBase, removeLeadingSlash, removeTrailingSlash, replaceLang, replaceVersion, slash, withBase, withoutBase, withoutHash, withoutLang };
712
+ export { APPEARANCE_KEY, AdditionalPage, BaseRuntimePageInfo, Config, Config$1 as DefaultThemeConfig, DocFooter, EditLink, Feature, Footer, FrontMatterMeta, HASH_REGEXP, Header, Hero, Image, LocalSearchOptions, Locale, LocaleConfig, LocaleLink, LocaleLinks, MDX_REGEXP, MarkdownOptions, Nav, NavItem, NavItemWithChildren, NavItemWithLink, NavItemWithLinkAndChildren, NormalizedConfig, NormalizedConfig as NormalizedDefaultThemeConfig, NormalizedLocales, NormalizedSidebar, NormalizedSidebarGroup, PageData, PageIndexInfo, PageModule, PageType, RspressPlugin as Plugin, QUERY_REGEXP, RSPRESS_TEMP_DIR, RemotePageInfo, RemoteSearchIndexInfo, RemoteSearchOptions, ReplaceRule, Route, RouteMeta, RouteOptions, RspressPlugin, SEARCH_INDEX_NAME, SearchHooks, SearchOptions, Sidebar, SidebarDivider, SidebarGroup, SidebarItem, SiteData, SocialLink, SocialLinkIcon, UserConfig, addLeadingSlash, addTrailingSlash, cleanUrl, inBrowser, isDebugMode, isExternalUrl, isProduction, isSCM, mergeDocConfig, normalizeHref, normalizePosixPath, normalizeSlash, omit, parseUrl, removeBase, removeHash, removeLeadingSlash, removeTrailingSlash, replaceLang, replaceVersion, slash, withBase, withoutBase, withoutHash, withoutLang };
package/dist/index.js CHANGED
@@ -41,6 +41,7 @@ __export(src_exports, {
41
41
  omit: () => omit,
42
42
  parseUrl: () => parseUrl,
43
43
  removeBase: () => removeBase,
44
+ removeHash: () => removeHash,
44
45
  removeLeadingSlash: () => removeLeadingSlash,
45
46
  removeTrailingSlash: () => removeTrailingSlash,
46
47
  replaceLang: () => replaceLang,
@@ -1122,6 +1123,9 @@ var cleanUrl = (url) => url.replace(HASH_REGEXP, "").replace(QUERY_REGEXP, "");
1122
1123
  function slash(str) {
1123
1124
  return str.replace(/\\/g, "/");
1124
1125
  }
1126
+ function removeHash(str) {
1127
+ return str.replace(/#.*$/, "");
1128
+ }
1125
1129
  function normalizePosixPath(id) {
1126
1130
  const path = slash(id);
1127
1131
  const isAbsolutePath = path.startsWith("/");
@@ -1308,6 +1312,7 @@ var mergeDocConfig = (...configs) => mergeWith_default({}, ...configs, (target,
1308
1312
  omit,
1309
1313
  parseUrl,
1310
1314
  removeBase,
1315
+ removeHash,
1311
1316
  removeLeadingSlash,
1312
1317
  removeTrailingSlash,
1313
1318
  replaceLang,
package/dist/index.mjs CHANGED
@@ -1067,6 +1067,9 @@ var cleanUrl = (url) => url.replace(HASH_REGEXP, "").replace(QUERY_REGEXP, "");
1067
1067
  function slash(str) {
1068
1068
  return str.replace(/\\/g, "/");
1069
1069
  }
1070
+ function removeHash(str) {
1071
+ return str.replace(/#.*$/, "");
1072
+ }
1070
1073
  function normalizePosixPath(id) {
1071
1074
  const path = slash(id);
1072
1075
  const isAbsolutePath = path.startsWith("/");
@@ -1252,6 +1255,7 @@ export {
1252
1255
  omit,
1253
1256
  parseUrl,
1254
1257
  removeBase,
1258
+ removeHash,
1255
1259
  removeLeadingSlash,
1256
1260
  removeTrailingSlash,
1257
1261
  replaceLang,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspress/shared",
3
- "version": "0.0.0-nightly-20231108160202",
3
+ "version": "0.0.0-nightly-20231109160316",
4
4
  "types": "./dist/index.d.ts",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",