@colisweb/rescript-toolkit 2.63.0 → 2.63.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@colisweb/rescript-toolkit",
3
- "version": "2.63.0",
3
+ "version": "2.63.1",
4
4
  "scripts": {
5
5
  "clean": "rescript clean",
6
6
  "build": "rescript build -with-deps",
@@ -57,8 +57,23 @@ module Make = (Config: RouterConfig) => {
57
57
 
58
58
  let useRoute = (): Config.t => RescriptReactRouter.useUrl()->Config.make
59
59
 
60
- let isRouteEqual = (routeA: Config.t, routeB: Config.t): bool =>
61
- routeA->Config.toString === routeB->Config.toString
60
+ let isRouteEqual = (routeA: Config.t, routeB: Config.t): bool => {
61
+ let routeA = {
62
+ let url = routeA->Config.toString
63
+ let queryParamsIndex = url->Js.String2.indexOf("?")
64
+
65
+ queryParamsIndex === -1 ? url : url->Js.String2.slice(~from=0, ~to_=queryParamsIndex)
66
+ }
67
+
68
+ let routeB = {
69
+ let url = routeB->Config.toString
70
+ let queryParamsIndex = url->Js.String2.indexOf("?")
71
+
72
+ queryParamsIndex === -1 ? url : url->Js.String2.slice(~from=0, ~to_=queryParamsIndex)
73
+ }
74
+
75
+ routeA === routeB
76
+ }
62
77
 
63
78
  let useIsCurrentRoute = (route: Config.t): bool => {
64
79
  let {currentRoute} = React.useContext(routerContext)