react-router
Advanced tools
Comparing version 6.2.1 to 6.2.2-pre.0
import * as React from "react"; | ||
import type { History, InitialEntry, Location, Path, To } from "history"; | ||
import { Action as NavigationType } from "history"; | ||
export type { Location, Path, To, NavigationType }; | ||
import type { Hash, History, InitialEntry, Location, Path, Pathname, Search, To } from "history"; | ||
import { Action as NavigationType, parsePath, createPath } from "history"; | ||
export { parsePath, createPath, NavigationType }; | ||
export type { Hash, Location, Path, Pathname, Search, To }; | ||
/** | ||
@@ -42,3 +43,3 @@ * A Navigator is a "location changer"; it's how you get to different locations. | ||
*/ | ||
export declare function MemoryRouter({ basename, children, initialEntries, initialIndex }: MemoryRouterProps): React.ReactElement; | ||
export declare function MemoryRouter({ basename, children, initialEntries, initialIndex, }: MemoryRouterProps): React.ReactElement; | ||
export interface NavigateProps { | ||
@@ -113,3 +114,3 @@ to: To; | ||
*/ | ||
export declare function Router({ basename: basenameProp, children, location: locationProp, navigationType, navigator, static: staticProp }: RouterProps): React.ReactElement | null; | ||
export declare function Router({ basename: basenameProp, children, location: locationProp, navigationType, navigator, static: staticProp, }: RouterProps): React.ReactElement | null; | ||
export interface RoutesProps { | ||
@@ -125,3 +126,3 @@ children?: React.ReactNode; | ||
*/ | ||
export declare function Routes({ children, location }: RoutesProps): React.ReactElement | null; | ||
export declare function Routes({ children, location, }: RoutesProps): React.ReactElement | null; | ||
/** | ||
@@ -343,2 +344,2 @@ * Returns the full href for the given "to" value. This is useful for building | ||
/** @internal */ | ||
export { NavigationContext as UNSAFE_NavigationContext, LocationContext as UNSAFE_LocationContext, RouteContext as UNSAFE_RouteContext }; | ||
export { NavigationContext as UNSAFE_NavigationContext, LocationContext as UNSAFE_LocationContext, RouteContext as UNSAFE_RouteContext, }; |
12
index.js
/** | ||
* React Router v6.2.1 | ||
* React Router v6.2.2-pre.0 | ||
* | ||
@@ -13,2 +13,3 @@ * Copyright (c) Remix Software Inc. | ||
import { createMemoryHistory, Action, parsePath } from 'history'; | ||
export { Action as NavigationType, createPath, parsePath } from 'history'; | ||
@@ -730,3 +731,3 @@ function invariant(cond, message) { | ||
pathname: joinPaths([matchedPathname, match.pathname]), | ||
pathnameBase: joinPaths([matchedPathname, match.pathnameBase]), | ||
pathnameBase: normalizePathname(joinPaths([matchedPathname, match.pathnameBase])), | ||
route | ||
@@ -759,3 +760,3 @@ }); | ||
return /*#__PURE__*/createElement(RouteContext.Provider, { | ||
children: match.route.element !== undefined ? match.route.element : /*#__PURE__*/createElement(Outlet, null), | ||
children: match.route.element !== undefined ? match.route.element : outlet, | ||
value: { | ||
@@ -841,3 +842,6 @@ outlet, | ||
// route "/home" should not match "/home2". | ||
"(?:\\b|\\/|$)"; | ||
// Additionally, allow paths starting with `.`, `-`, `~`, and url-encoded entities, | ||
// but do not consume the character in the matched path so they can match against | ||
// nested paths. | ||
"(?:(?=[.~-]|%[0-9A-F]{2})|\\b|\\/|$)"; | ||
} | ||
@@ -844,0 +848,0 @@ |
/** | ||
* React Router v6.2.1 | ||
* React Router v6.2.2-pre.0 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
{ | ||
"name": "react-router", | ||
"version": "6.2.1", | ||
"version": "6.2.2-pre.0", | ||
"author": "Remix Software <hello@remix.run>", | ||
@@ -5,0 +5,0 @@ "description": "Declarative routing for React", |
/** | ||
* React Router v6.2.1 | ||
* React Router v6.2.2-pre.0 | ||
* | ||
@@ -13,2 +13,3 @@ * Copyright (c) Remix Software Inc. | ||
import { createMemoryHistory, Action, parsePath } from 'history'; | ||
export { Action as NavigationType, createPath, parsePath } from 'history'; | ||
@@ -700,3 +701,3 @@ function invariant(cond, message) { | ||
pathname: joinPaths([matchedPathname, match.pathname]), | ||
pathnameBase: joinPaths([matchedPathname, match.pathnameBase]), | ||
pathnameBase: normalizePathname(joinPaths([matchedPathname, match.pathnameBase])), | ||
route | ||
@@ -725,3 +726,3 @@ }); | ||
return /*#__PURE__*/createElement(RouteContext.Provider, { | ||
children: match.route.element !== undefined ? match.route.element : /*#__PURE__*/createElement(Outlet, null), | ||
children: match.route.element !== undefined ? match.route.element : outlet, | ||
value: { | ||
@@ -799,3 +800,6 @@ outlet, | ||
// route "/home" should not match "/home2". | ||
"(?:\\b|\\/|$)"; | ||
// Additionally, allow paths starting with `.`, `-`, `~`, and url-encoded entities, | ||
// but do not consume the character in the matched path so they can match against | ||
// nested paths. | ||
"(?:(?=[.~-]|%[0-9A-F]{2})|\\b|\\/|$)"; | ||
} | ||
@@ -802,0 +806,0 @@ |
/** | ||
* React Router v6.2.1 | ||
* React Router v6.2.2-pre.0 | ||
* | ||
@@ -11,3 +11,3 @@ * Copyright (c) Remix Software Inc. | ||
*/ | ||
import{createContext as e,useRef as t,useState as n,useLayoutEffect as a,createElement as r,useContext as l,useEffect as i,useMemo as s,useCallback as o,Children as u,isValidElement as c,Fragment as h}from"react";import{createMemoryHistory as p,Action as m,parsePath as f}from"history";function g(e,t){if(!e)throw new Error(t)}const d=e(null),v=e(null),y=e({outlet:null,matches:[]});function x({basename:e,children:l,initialEntries:i,initialIndex:s}){let o=t();null==o.current&&(o.current=p({initialEntries:i,initialIndex:s}));let u=o.current,[c,h]=n({action:u.action,location:u.location});return a((()=>u.listen(h)),[u]),r(W,{basename:e,children:l,location:c.location,navigationType:c.action,navigator:u})}function S({to:e,replace:t,state:n}){E()||g(!1);let a=j();return i((()=>{a(e,{replace:t,state:n})})),null}function $(e){return A(e.context)}function P(e){g(!1)}function W({basename:e="/",children:t=null,location:n,navigationType:a=m.Pop,navigator:l,static:i=!1}){E()&&g(!1);let o=Y(e),u=s((()=>({basename:o,navigator:l,static:i})),[o,l,i]);"string"==typeof n&&(n=f(n));let{pathname:c="/",search:h="",hash:p="",state:y=null,key:x="default"}=n,S=s((()=>{let e=V(c,o);return null==e?null:{pathname:e,search:h,hash:p,state:y,key:x}}),[o,c,h,p,y,x]);return null==S?null:r(d.Provider,{value:u},r(v.Provider,{children:t,value:{location:S,navigationType:a}}))}function b({children:e,location:t}){return R(T(e),t)}function B(e){E()||g(!1);let{basename:t,navigator:n}=l(d),{hash:a,pathname:r,search:i}=M(e),s=r;if("/"!==t){let n=function(e){return""===e||""===e.pathname?"/":"string"==typeof e?f(e).pathname:e.pathname}(e),a=null!=n&&n.endsWith("/");s="/"===r?t+(a?"/":""):X([t,r])}return n.createHref({pathname:s,search:i,hash:a})}function E(){return null!=l(v)}function w(){return E()||g(!1),l(v).location}function N(){return l(v).navigationType}function O(e){E()||g(!1);let{pathname:t}=w();return s((()=>G(e,t)),[t,e])}function j(){E()||g(!1);let{basename:e,navigator:n}=l(d),{matches:a}=l(y),{pathname:r}=w(),s=JSON.stringify(a.map((e=>e.pathnameBase))),u=t(!1);return i((()=>{u.current=!0})),o(((t,a={})=>{if(!u.current)return;if("number"==typeof t)return void n.go(t);let l=Q(t,JSON.parse(s),r);"/"!==e&&(l.pathname=X([e,l.pathname])),(a.replace?n.replace:n.push)(l,a.state)}),[e,n,s,r])}const C=e(null);function I(){return l(C)}function A(e){let t=l(y).outlet;return t?r(C.Provider,{value:e},t):t}function J(){let{matches:e}=l(y),t=e[e.length-1];return t?t.params:{}}function M(e){let{matches:t}=l(y),{pathname:n}=w(),a=JSON.stringify(t.map((e=>e.pathnameBase)));return s((()=>Q(e,JSON.parse(a),n)),[e,a,n])}function R(e,t){E()||g(!1);let n,{matches:a}=l(y),r=a[a.length-1],i=r?r.params:{},s=(r&&r.pathname,r?r.pathnameBase:"/"),o=(r&&r.route,w());if(t){let e="string"==typeof t?f(t):t;"/"===s||e.pathname?.startsWith(s)||g(!1),n=e}else n=o;let u=n.pathname||"/",c=F(e,{pathname:"/"===s?u:u.slice(s.length)||"/"});return D(c&&c.map((e=>Object.assign({},e,{params:Object.assign({},i,e.params),pathname:X([s,e.pathname]),pathnameBase:"/"===e.pathnameBase?s:X([s,e.pathnameBase])}))),a)}function T(e){let t=[];return u.forEach(e,(e=>{if(!c(e))return;if(e.type===h)return void t.push.apply(t,T(e.props.children));e.type!==P&&g(!1);let n={caseSensitive:e.props.caseSensitive,element:e.props.element,index:e.props.index,path:e.props.path};e.props.children&&(n.children=T(e.props.children)),t.push(n)})),t}function U(e,t={}){return e.replace(/:(\w+)/g,((e,n)=>(null==t[n]&&g(!1),t[n]))).replace(/\/*\*$/,(e=>null==t["*"]?"":t["*"].replace(/^\/*/,"/")))}function F(e,t,n="/"){let a=V(("string"==typeof t?f(t):t).pathname||"/",n);if(null==a)return null;let r=L(e);!function(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){return e.length===t.length&&e.slice(0,-1).every(((e,n)=>e===t[n]))?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}(r);let l=null;for(let i=0;null==l&&i<r.length;++i)l=q(r[i],a);return l}function L(e,t=[],n=[],a=""){return e.forEach(((e,r)=>{let l={relativePath:e.path||"",caseSensitive:!0===e.caseSensitive,childrenIndex:r,route:e};l.relativePath.startsWith("/")&&(l.relativePath.startsWith(a)||g(!1),l.relativePath=l.relativePath.slice(a.length));let i=X([a,l.relativePath]),s=n.concat(l);e.children&&e.children.length>0&&(!0===e.index&&g(!1),L(e.children,t,s,i)),(null!=e.path||e.index)&&t.push({path:i,score:H(i,e.index),routesMeta:s})})),t}const _=/^:\w+$/,k=e=>"*"===e;function H(e,t){let n=e.split("/"),a=n.length;return n.some(k)&&(a+=-2),t&&(a+=2),n.filter((e=>!k(e))).reduce(((e,t)=>e+(_.test(t)?3:""===t?1:10)),a)}function q(e,t){let{routesMeta:n}=e,a={},r="/",l=[];for(let i=0;i<n.length;++i){let e=n[i],s=i===n.length-1,o="/"===r?t:t.slice(r.length)||"/",u=G({path:e.relativePath,caseSensitive:e.caseSensitive,end:s},o);if(!u)return null;Object.assign(a,u.params);let c=e.route;l.push({params:a,pathname:X([r,u.pathname]),pathnameBase:X([r,u.pathnameBase]),route:c}),"/"!==u.pathnameBase&&(r=X([r,u.pathnameBase]))}return l}function z(e){return D(e)}function D(e,t=[]){return null==e?null:e.reduceRight(((n,a,l)=>r(y.Provider,{children:void 0!==a.route.element?a.route.element:r($,null),value:{outlet:n,matches:t.concat(e.slice(0,l+1))}})),null)}function G(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[n,a]=function(e,t=!1,n=!0){let a=[],r="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/:(\w+)/g,((e,t)=>(a.push(t),"([^\\/]+)")));e.endsWith("*")?(a.push("*"),r+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):r+=n?"\\/*$":"(?:\\b|\\/|$)";return[new RegExp(r,t?void 0:"i"),a]}(e.path,e.caseSensitive,e.end),r=t.match(n);if(!r)return null;let l=r[0],i=l.replace(/(.)\/+$/,"$1"),s=r.slice(1);return{params:a.reduce(((e,t,n)=>{if("*"===t){let e=s[n]||"";i=l.slice(0,l.length-e.length).replace(/(.)\/+$/,"$1")}return e[t]=function(e,t){try{return decodeURIComponent(e)}catch(n){return e}}(s[n]||""),e}),{}),pathname:l,pathnameBase:i,pattern:e}}function K(e,t="/"){let{pathname:n,search:a="",hash:r=""}="string"==typeof e?f(e):e,l=n?n.startsWith("/")?n:function(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)})),n.length>1?n.join("/"):"/"}(n,t):t;return{pathname:l,search:Z(a),hash:ee(r)}}function Q(e,t,n){let a,r="string"==typeof e?f(e):e,l=""===e||""===r.pathname?"/":r.pathname;if(null==l)a=n;else{let e=t.length-1;if(l.startsWith("..")){let t=l.split("/");for(;".."===t[0];)t.shift(),e-=1;r.pathname=t.join("/")}a=e>=0?t[e]:"/"}let i=K(r,a);return l&&"/"!==l&&l.endsWith("/")&&!i.pathname.endsWith("/")&&(i.pathname+="/"),i}function V(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=e.charAt(t.length);return n&&"/"!==n?null:e.slice(t.length)||"/"}const X=e=>e.join("/").replace(/\/\/+/g,"/"),Y=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Z=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",ee=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";export{x as MemoryRouter,S as Navigate,$ as Outlet,P as Route,W as Router,b as Routes,v as UNSAFE_LocationContext,d as UNSAFE_NavigationContext,y as UNSAFE_RouteContext,T as createRoutesFromChildren,U as generatePath,G as matchPath,F as matchRoutes,z as renderMatches,K as resolvePath,B as useHref,E as useInRouterContext,w as useLocation,O as useMatch,j as useNavigate,N as useNavigationType,A as useOutlet,I as useOutletContext,J as useParams,M as useResolvedPath,R as useRoutes}; | ||
import{createContext as e,useRef as t,useState as n,useLayoutEffect as a,createElement as r,useContext as l,useEffect as i,useMemo as s,useCallback as o,Children as h,isValidElement as c,Fragment as u}from"react";import{createMemoryHistory as p,Action as m,parsePath as f}from"history";export{Action as NavigationType,createPath,parsePath}from"history";function g(e,t){if(!e)throw new Error(t)}const d=e(null),v=e(null),y=e({outlet:null,matches:[]});function x({basename:e,children:l,initialEntries:i,initialIndex:s}){let o=t();null==o.current&&(o.current=p({initialEntries:i,initialIndex:s}));let h=o.current,[c,u]=n({action:h.action,location:h.location});return a((()=>h.listen(u)),[h]),r(W,{basename:e,children:l,location:c.location,navigationType:c.action,navigator:h})}function S({to:e,replace:t,state:n}){E()||g(!1);let a=j();return i((()=>{a(e,{replace:t,state:n})})),null}function $(e){return I(e.context)}function P(e){g(!1)}function W({basename:e="/",children:t=null,location:n,navigationType:a=m.Pop,navigator:l,static:i=!1}){E()&&g(!1);let o=Y(e),h=s((()=>({basename:o,navigator:l,static:i})),[o,l,i]);"string"==typeof n&&(n=f(n));let{pathname:c="/",search:u="",hash:p="",state:y=null,key:x="default"}=n,S=s((()=>{let e=V(c,o);return null==e?null:{pathname:e,search:u,hash:p,state:y,key:x}}),[o,c,u,p,y,x]);return null==S?null:r(d.Provider,{value:h},r(v.Provider,{children:t,value:{location:S,navigationType:a}}))}function b({children:e,location:t}){return J(M(e),t)}function B(e){E()||g(!1);let{basename:t,navigator:n}=l(d),{hash:a,pathname:r,search:i}=F(e),s=r;if("/"!==t){let n=function(e){return""===e||""===e.pathname?"/":"string"==typeof e?f(e).pathname:e.pathname}(e),a=null!=n&&n.endsWith("/");s="/"===r?t+(a?"/":""):X([t,r])}return n.createHref({pathname:s,search:i,hash:a})}function E(){return null!=l(v)}function N(){return E()||g(!1),l(v).location}function w(){return l(v).navigationType}function O(e){E()||g(!1);let{pathname:t}=N();return s((()=>G(e,t)),[t,e])}function j(){E()||g(!1);let{basename:e,navigator:n}=l(d),{matches:a}=l(y),{pathname:r}=N(),s=JSON.stringify(a.map((e=>e.pathnameBase))),h=t(!1);return i((()=>{h.current=!0})),o(((t,a={})=>{if(!h.current)return;if("number"==typeof t)return void n.go(t);let l=Q(t,JSON.parse(s),r);"/"!==e&&(l.pathname=X([e,l.pathname])),(a.replace?n.replace:n.push)(l,a.state)}),[e,n,s,r])}const A=e(null);function C(){return l(A)}function I(e){let t=l(y).outlet;return t?r(A.Provider,{value:e},t):t}function T(){let{matches:e}=l(y),t=e[e.length-1];return t?t.params:{}}function F(e){let{matches:t}=l(y),{pathname:n}=N(),a=JSON.stringify(t.map((e=>e.pathnameBase)));return s((()=>Q(e,JSON.parse(a),n)),[e,a,n])}function J(e,t){E()||g(!1);let n,{matches:a}=l(y),r=a[a.length-1],i=r?r.params:{},s=(r&&r.pathname,r?r.pathnameBase:"/"),o=(r&&r.route,N());if(t){let e="string"==typeof t?f(t):t;"/"===s||e.pathname?.startsWith(s)||g(!1),n=e}else n=o;let h=n.pathname||"/",c=U(e,{pathname:"/"===s?h:h.slice(s.length)||"/"});return D(c&&c.map((e=>Object.assign({},e,{params:Object.assign({},i,e.params),pathname:X([s,e.pathname]),pathnameBase:"/"===e.pathnameBase?s:X([s,e.pathnameBase])}))),a)}function M(e){let t=[];return h.forEach(e,(e=>{if(!c(e))return;if(e.type===u)return void t.push.apply(t,M(e.props.children));e.type!==P&&g(!1);let n={caseSensitive:e.props.caseSensitive,element:e.props.element,index:e.props.index,path:e.props.path};e.props.children&&(n.children=M(e.props.children)),t.push(n)})),t}function R(e,t={}){return e.replace(/:(\w+)/g,((e,n)=>(null==t[n]&&g(!1),t[n]))).replace(/\/*\*$/,(e=>null==t["*"]?"":t["*"].replace(/^\/*/,"/")))}function U(e,t,n="/"){let a=V(("string"==typeof t?f(t):t).pathname||"/",n);if(null==a)return null;let r=L(e);!function(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){return e.length===t.length&&e.slice(0,-1).every(((e,n)=>e===t[n]))?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}(r);let l=null;for(let i=0;null==l&&i<r.length;++i)l=q(r[i],a);return l}function L(e,t=[],n=[],a=""){return e.forEach(((e,r)=>{let l={relativePath:e.path||"",caseSensitive:!0===e.caseSensitive,childrenIndex:r,route:e};l.relativePath.startsWith("/")&&(l.relativePath.startsWith(a)||g(!1),l.relativePath=l.relativePath.slice(a.length));let i=X([a,l.relativePath]),s=n.concat(l);e.children&&e.children.length>0&&(!0===e.index&&g(!1),L(e.children,t,s,i)),(null!=e.path||e.index)&&t.push({path:i,score:H(i,e.index),routesMeta:s})})),t}const _=/^:\w+$/,k=e=>"*"===e;function H(e,t){let n=e.split("/"),a=n.length;return n.some(k)&&(a+=-2),t&&(a+=2),n.filter((e=>!k(e))).reduce(((e,t)=>e+(_.test(t)?3:""===t?1:10)),a)}function q(e,t){let{routesMeta:n}=e,a={},r="/",l=[];for(let i=0;i<n.length;++i){let e=n[i],s=i===n.length-1,o="/"===r?t:t.slice(r.length)||"/",h=G({path:e.relativePath,caseSensitive:e.caseSensitive,end:s},o);if(!h)return null;Object.assign(a,h.params);let c=e.route;l.push({params:a,pathname:X([r,h.pathname]),pathnameBase:Y(X([r,h.pathnameBase])),route:c}),"/"!==h.pathnameBase&&(r=X([r,h.pathnameBase]))}return l}function z(e){return D(e)}function D(e,t=[]){return null==e?null:e.reduceRight(((n,a,l)=>r(y.Provider,{children:void 0!==a.route.element?a.route.element:n,value:{outlet:n,matches:t.concat(e.slice(0,l+1))}})),null)}function G(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[n,a]=function(e,t=!1,n=!0){let a=[],r="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/:(\w+)/g,((e,t)=>(a.push(t),"([^\\/]+)")));e.endsWith("*")?(a.push("*"),r+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):r+=n?"\\/*$":"(?:(?=[.~-]|%[0-9A-F]{2})|\\b|\\/|$)";return[new RegExp(r,t?void 0:"i"),a]}(e.path,e.caseSensitive,e.end),r=t.match(n);if(!r)return null;let l=r[0],i=l.replace(/(.)\/+$/,"$1"),s=r.slice(1);return{params:a.reduce(((e,t,n)=>{if("*"===t){let e=s[n]||"";i=l.slice(0,l.length-e.length).replace(/(.)\/+$/,"$1")}return e[t]=function(e,t){try{return decodeURIComponent(e)}catch(n){return e}}(s[n]||""),e}),{}),pathname:l,pathnameBase:i,pattern:e}}function K(e,t="/"){let{pathname:n,search:a="",hash:r=""}="string"==typeof e?f(e):e,l=n?n.startsWith("/")?n:function(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)})),n.length>1?n.join("/"):"/"}(n,t):t;return{pathname:l,search:Z(a),hash:ee(r)}}function Q(e,t,n){let a,r="string"==typeof e?f(e):e,l=""===e||""===r.pathname?"/":r.pathname;if(null==l)a=n;else{let e=t.length-1;if(l.startsWith("..")){let t=l.split("/");for(;".."===t[0];)t.shift(),e-=1;r.pathname=t.join("/")}a=e>=0?t[e]:"/"}let i=K(r,a);return l&&"/"!==l&&l.endsWith("/")&&!i.pathname.endsWith("/")&&(i.pathname+="/"),i}function V(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=e.charAt(t.length);return n&&"/"!==n?null:e.slice(t.length)||"/"}const X=e=>e.join("/").replace(/\/\/+/g,"/"),Y=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Z=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",ee=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";export{x as MemoryRouter,S as Navigate,$ as Outlet,P as Route,W as Router,b as Routes,v as UNSAFE_LocationContext,d as UNSAFE_NavigationContext,y as UNSAFE_RouteContext,M as createRoutesFromChildren,R as generatePath,G as matchPath,U as matchRoutes,z as renderMatches,K as resolvePath,B as useHref,E as useInRouterContext,N as useLocation,O as useMatch,j as useNavigate,w as useNavigationType,I as useOutlet,C as useOutletContext,T as useParams,F as useResolvedPath,J as useRoutes}; | ||
//# sourceMappingURL=react-router.production.min.js.map |
# React Router | ||
The `react-router` package is the heart of [React Router](/) and provides all | ||
The `react-router` package is the heart of [React Router](https://github.com/remix-run/react-router) and provides all | ||
the core functionality for both | ||
@@ -5,0 +5,0 @@ [`react-router-dom`](/packages/react-router-dom) |
/** | ||
* React Router v6.2.1 | ||
* React Router v6.2.2-pre.0 | ||
* | ||
@@ -732,3 +732,3 @@ * Copyright (c) Remix Software Inc. | ||
pathname: joinPaths([matchedPathname, match.pathname]), | ||
pathnameBase: joinPaths([matchedPathname, match.pathnameBase]), | ||
pathnameBase: normalizePathname(joinPaths([matchedPathname, match.pathnameBase])), | ||
route | ||
@@ -761,3 +761,3 @@ }); | ||
return /*#__PURE__*/React.createElement(RouteContext.Provider, { | ||
children: match.route.element !== undefined ? match.route.element : /*#__PURE__*/React.createElement(Outlet, null), | ||
children: match.route.element !== undefined ? match.route.element : outlet, | ||
value: { | ||
@@ -843,3 +843,6 @@ outlet, | ||
// route "/home" should not match "/home2". | ||
"(?:\\b|\\/|$)"; | ||
// Additionally, allow paths starting with `.`, `-`, `~`, and url-encoded entities, | ||
// but do not consume the character in the matched path so they can match against | ||
// nested paths. | ||
"(?:(?=[.~-]|%[0-9A-F]{2})|\\b|\\/|$)"; | ||
} | ||
@@ -972,2 +975,20 @@ | ||
Object.defineProperty(exports, 'NavigationType', { | ||
enumerable: true, | ||
get: function () { | ||
return history.Action; | ||
} | ||
}); | ||
Object.defineProperty(exports, 'createPath', { | ||
enumerable: true, | ||
get: function () { | ||
return history.createPath; | ||
} | ||
}); | ||
Object.defineProperty(exports, 'parsePath', { | ||
enumerable: true, | ||
get: function () { | ||
return history.parsePath; | ||
} | ||
}); | ||
exports.MemoryRouter = MemoryRouter; | ||
@@ -974,0 +995,0 @@ exports.Navigate = Navigate; |
/** | ||
* React Router v6.2.1 | ||
* React Router v6.2.2-pre.0 | ||
* | ||
@@ -11,3 +11,3 @@ * Copyright (c) Remix Software Inc. | ||
*/ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("history")):"function"==typeof define&&define.amd?define(["exports","react","history"],t):t((e=e||self).ReactRouter={},e.React,e.HistoryLibrary)}(this,(function(e,t,n){"use strict";function a(e,t){if(!e)throw new Error(t)}const r=t.createContext(null),i=t.createContext(null),l=t.createContext({outlet:null,matches:[]});function s(e){return m(e.context)}function o(e){a(!1)}function u(e){let{basename:l="/",children:s=null,location:o,navigationType:u=n.Action.Pop,navigator:h,static:p=!1}=e;c()&&a(!1);let f=N(l),m=t.useMemo((()=>({basename:f,navigator:h,static:p})),[f,h,p]);"string"==typeof o&&(o=n.parsePath(o));let{pathname:d="/",search:v="",hash:g="",state:x=null,key:y="default"}=o,C=t.useMemo((()=>{let e=W(d,f);return null==e?null:{pathname:e,search:v,hash:g,state:x,key:y}}),[f,d,v,g,x,y]);return null==C?null:t.createElement(r.Provider,{value:m},t.createElement(i.Provider,{children:s,value:{location:C,navigationType:u}}))}function c(){return null!=t.useContext(i)}function h(){return c()||a(!1),t.useContext(i).location}function p(){c()||a(!1);let{basename:e,navigator:n}=t.useContext(r),{matches:i}=t.useContext(l),{pathname:s}=h(),o=JSON.stringify(i.map((e=>e.pathnameBase))),u=t.useRef(!1);return t.useEffect((()=>{u.current=!0})),t.useCallback((function(t,a){if(void 0===a&&(a={}),!u.current)return;if("number"==typeof t)return void n.go(t);let r=M(t,JSON.parse(o),s);"/"!==e&&(r.pathname=B([e,r.pathname])),(a.replace?n.replace:n.push)(r,a.state)}),[e,n,o,s])}const f=t.createContext(null);function m(e){let n=t.useContext(l).outlet;return n?t.createElement(f.Provider,{value:e},n):n}function d(e){let{matches:n}=t.useContext(l),{pathname:a}=h(),r=JSON.stringify(n.map((e=>e.pathnameBase)));return t.useMemo((()=>M(e,JSON.parse(r),a)),[e,r,a])}function v(e,r){c()||a(!1);let i,{matches:s}=t.useContext(l),o=s[s.length-1],u=o?o.params:{},p=(o&&o.pathname,o?o.pathnameBase:"/"),f=(o&&o.route,h());if(r){var m;let e="string"==typeof r?n.parsePath(r):r;"/"===p||(null==(m=e.pathname)?void 0:m.startsWith(p))||a(!1),i=e}else i=f;let d=i.pathname||"/",v=x(e,{pathname:"/"===p?d:d.slice(p.length)||"/"});return S(v&&v.map((e=>Object.assign({},e,{params:Object.assign({},u,e.params),pathname:B([p,e.pathname]),pathnameBase:"/"===e.pathnameBase?p:B([p,e.pathnameBase])}))),s)}function g(e){let n=[];return t.Children.forEach(e,(e=>{if(!t.isValidElement(e))return;if(e.type===t.Fragment)return void n.push.apply(n,g(e.props.children));e.type!==o&&a(!1);let r={caseSensitive:e.props.caseSensitive,element:e.props.element,index:e.props.index,path:e.props.path};e.props.children&&(r.children=g(e.props.children)),n.push(r)})),n}function x(e,t,a){void 0===a&&(a="/");let r=W(("string"==typeof t?n.parsePath(t):t).pathname||"/",a);if(null==r)return null;let i=y(e);!function(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){return e.length===t.length&&e.slice(0,-1).every(((e,n)=>e===t[n]))?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}(i);let l=null;for(let e=0;null==l&&e<i.length;++e)l=R(i[e],r);return l}function y(e,t,n,r){return void 0===t&&(t=[]),void 0===n&&(n=[]),void 0===r&&(r=""),e.forEach(((e,i)=>{let l={relativePath:e.path||"",caseSensitive:!0===e.caseSensitive,childrenIndex:i,route:e};l.relativePath.startsWith("/")&&(l.relativePath.startsWith(r)||a(!1),l.relativePath=l.relativePath.slice(r.length));let s=B([r,l.relativePath]),o=n.concat(l);e.children&&e.children.length>0&&(!0===e.index&&a(!1),y(e.children,t,o,s)),(null!=e.path||e.index)&&t.push({path:s,score:E(s,e.index),routesMeta:o})})),t}const C=/^:\w+$/,P=e=>"*"===e;function E(e,t){let n=e.split("/"),a=n.length;return n.some(P)&&(a+=-2),t&&(a+=2),n.filter((e=>!P(e))).reduce(((e,t)=>e+(C.test(t)?3:""===t?1:10)),a)}function R(e,t){let{routesMeta:n}=e,a={},r="/",i=[];for(let e=0;e<n.length;++e){let l=n[e],s=e===n.length-1,o="/"===r?t:t.slice(r.length)||"/",u=b({path:l.relativePath,caseSensitive:l.caseSensitive,end:s},o);if(!u)return null;Object.assign(a,u.params);let c=l.route;i.push({params:a,pathname:B([r,u.pathname]),pathnameBase:B([r,u.pathnameBase]),route:c}),"/"!==u.pathnameBase&&(r=B([r,u.pathnameBase]))}return i}function S(e,n){return void 0===n&&(n=[]),null==e?null:e.reduceRight(((a,r,i)=>t.createElement(l.Provider,{children:void 0!==r.route.element?r.route.element:t.createElement(s,null),value:{outlet:a,matches:n.concat(e.slice(0,i+1))}})),null)}function b(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[n,a]=function(e,t,n){void 0===t&&(t=!1);void 0===n&&(n=!0);let a=[],r="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/:(\w+)/g,((e,t)=>(a.push(t),"([^\\/]+)")));e.endsWith("*")?(a.push("*"),r+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):r+=n?"\\/*$":"(?:\\b|\\/|$)";return[new RegExp(r,t?void 0:"i"),a]}(e.path,e.caseSensitive,e.end),r=t.match(n);if(!r)return null;let i=r[0],l=i.replace(/(.)\/+$/,"$1"),s=r.slice(1);return{params:a.reduce(((e,t,n)=>{if("*"===t){let e=s[n]||"";l=i.slice(0,i.length-e.length).replace(/(.)\/+$/,"$1")}return e[t]=function(e,t){try{return decodeURIComponent(e)}catch(t){return e}}(s[n]||""),e}),{}),pathname:i,pathnameBase:l,pattern:e}}function $(e,t){void 0===t&&(t="/");let{pathname:a,search:r="",hash:i=""}="string"==typeof e?n.parsePath(e):e,l=a?a.startsWith("/")?a:function(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)})),n.length>1?n.join("/"):"/"}(a,t):t;return{pathname:l,search:O(r),hash:j(i)}}function M(e,t,a){let r,i="string"==typeof e?n.parsePath(e):e,l=""===e||""===i.pathname?"/":i.pathname;if(null==l)r=a;else{let e=t.length-1;if(l.startsWith("..")){let t=l.split("/");for(;".."===t[0];)t.shift(),e-=1;i.pathname=t.join("/")}r=e>=0?t[e]:"/"}let s=$(i,r);return l&&"/"!==l&&l.endsWith("/")&&!s.pathname.endsWith("/")&&(s.pathname+="/"),s}function W(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=e.charAt(t.length);return n&&"/"!==n?null:e.slice(t.length)||"/"}const B=e=>e.join("/").replace(/\/\/+/g,"/"),N=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),O=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",j=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";e.MemoryRouter=function(e){let{basename:a,children:r,initialEntries:i,initialIndex:l}=e,s=t.useRef();null==s.current&&(s.current=n.createMemoryHistory({initialEntries:i,initialIndex:l}));let o=s.current,[c,h]=t.useState({action:o.action,location:o.location});return t.useLayoutEffect((()=>o.listen(h)),[o]),t.createElement(u,{basename:a,children:r,location:c.location,navigationType:c.action,navigator:o})},e.Navigate=function(e){let{to:n,replace:r,state:i}=e;c()||a(!1);let l=p();return t.useEffect((()=>{l(n,{replace:r,state:i})})),null},e.Outlet=s,e.Route=o,e.Router=u,e.Routes=function(e){let{children:t,location:n}=e;return v(g(t),n)},e.UNSAFE_LocationContext=i,e.UNSAFE_NavigationContext=r,e.UNSAFE_RouteContext=l,e.createRoutesFromChildren=g,e.generatePath=function(e,t){return void 0===t&&(t={}),e.replace(/:(\w+)/g,((e,n)=>(null==t[n]&&a(!1),t[n]))).replace(/\/*\*$/,(e=>null==t["*"]?"":t["*"].replace(/^\/*/,"/")))},e.matchPath=b,e.matchRoutes=x,e.renderMatches=function(e){return S(e)},e.resolvePath=$,e.useHref=function(e){c()||a(!1);let{basename:i,navigator:l}=t.useContext(r),{hash:s,pathname:o,search:u}=d(e),h=o;if("/"!==i){let t=function(e){return""===e||""===e.pathname?"/":"string"==typeof e?n.parsePath(e).pathname:e.pathname}(e),a=null!=t&&t.endsWith("/");h="/"===o?i+(a?"/":""):B([i,o])}return l.createHref({pathname:h,search:u,hash:s})},e.useInRouterContext=c,e.useLocation=h,e.useMatch=function(e){c()||a(!1);let{pathname:n}=h();return t.useMemo((()=>b(e,n)),[n,e])},e.useNavigate=p,e.useNavigationType=function(){return t.useContext(i).navigationType},e.useOutlet=m,e.useOutletContext=function(){return t.useContext(f)},e.useParams=function(){let{matches:e}=t.useContext(l),n=e[e.length-1];return n?n.params:{}},e.useResolvedPath=d,e.useRoutes=v,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("history")):"function"==typeof define&&define.amd?define(["exports","react","history"],t):t((e=e||self).ReactRouter={},e.React,e.HistoryLibrary)}(this,(function(e,t,n){"use strict";function a(e,t){if(!e)throw new Error(t)}const r=t.createContext(null),i=t.createContext(null),l=t.createContext({outlet:null,matches:[]});function o(e){a(!1)}function s(e){let{basename:l="/",children:o=null,location:s,navigationType:c=n.Action.Pop,navigator:h,static:p=!1}=e;u()&&a(!1);let f=N(l),m=t.useMemo((()=>({basename:f,navigator:h,static:p})),[f,h,p]);"string"==typeof s&&(s=n.parsePath(s));let{pathname:d="/",search:g="",hash:v="",state:y=null,key:x="default"}=s,P=t.useMemo((()=>{let e=O(d,f);return null==e?null:{pathname:e,search:g,hash:v,state:y,key:x}}),[f,d,g,v,y,x]);return null==P?null:t.createElement(r.Provider,{value:m},t.createElement(i.Provider,{children:o,value:{location:P,navigationType:c}}))}function u(){return null!=t.useContext(i)}function c(){return u()||a(!1),t.useContext(i).location}function h(){u()||a(!1);let{basename:e,navigator:n}=t.useContext(r),{matches:i}=t.useContext(l),{pathname:o}=c(),s=JSON.stringify(i.map((e=>e.pathnameBase))),h=t.useRef(!1);return t.useEffect((()=>{h.current=!0})),t.useCallback((function(t,a){if(void 0===a&&(a={}),!h.current)return;if("number"==typeof t)return void n.go(t);let r=$(t,JSON.parse(s),o);"/"!==e&&(r.pathname=M([e,r.pathname])),(a.replace?n.replace:n.push)(r,a.state)}),[e,n,s,o])}const p=t.createContext(null);function f(e){let n=t.useContext(l).outlet;return n?t.createElement(p.Provider,{value:e},n):n}function m(e){let{matches:n}=t.useContext(l),{pathname:a}=c(),r=JSON.stringify(n.map((e=>e.pathnameBase)));return t.useMemo((()=>$(e,JSON.parse(r),a)),[e,r,a])}function d(e,r){u()||a(!1);let i,{matches:o}=t.useContext(l),s=o[o.length-1],h=s?s.params:{},p=(s&&s.pathname,s?s.pathnameBase:"/"),f=(s&&s.route,c());if(r){var m;let e="string"==typeof r?n.parsePath(r):r;"/"===p||(null==(m=e.pathname)?void 0:m.startsWith(p))||a(!1),i=e}else i=f;let d=i.pathname||"/",g=v(e,{pathname:"/"===p?d:d.slice(p.length)||"/"});return E(g&&g.map((e=>Object.assign({},e,{params:Object.assign({},h,e.params),pathname:M([p,e.pathname]),pathnameBase:"/"===e.pathnameBase?p:M([p,e.pathnameBase])}))),o)}function g(e){let n=[];return t.Children.forEach(e,(e=>{if(!t.isValidElement(e))return;if(e.type===t.Fragment)return void n.push.apply(n,g(e.props.children));e.type!==o&&a(!1);let r={caseSensitive:e.props.caseSensitive,element:e.props.element,index:e.props.index,path:e.props.path};e.props.children&&(r.children=g(e.props.children)),n.push(r)})),n}function v(e,t,a){void 0===a&&(a="/");let r=O(("string"==typeof t?n.parsePath(t):t).pathname||"/",a);if(null==r)return null;let i=y(e);!function(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){return e.length===t.length&&e.slice(0,-1).every(((e,n)=>e===t[n]))?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}(i);let l=null;for(let e=0;null==l&&e<i.length;++e)l=b(i[e],r);return l}function y(e,t,n,r){return void 0===t&&(t=[]),void 0===n&&(n=[]),void 0===r&&(r=""),e.forEach(((e,i)=>{let l={relativePath:e.path||"",caseSensitive:!0===e.caseSensitive,childrenIndex:i,route:e};l.relativePath.startsWith("/")&&(l.relativePath.startsWith(r)||a(!1),l.relativePath=l.relativePath.slice(r.length));let o=M([r,l.relativePath]),s=n.concat(l);e.children&&e.children.length>0&&(!0===e.index&&a(!1),y(e.children,t,s,o)),(null!=e.path||e.index)&&t.push({path:o,score:C(o,e.index),routesMeta:s})})),t}const x=/^:\w+$/,P=e=>"*"===e;function C(e,t){let n=e.split("/"),a=n.length;return n.some(P)&&(a+=-2),t&&(a+=2),n.filter((e=>!P(e))).reduce(((e,t)=>e+(x.test(t)?3:""===t?1:10)),a)}function b(e,t){let{routesMeta:n}=e,a={},r="/",i=[];for(let e=0;e<n.length;++e){let l=n[e],o=e===n.length-1,s="/"===r?t:t.slice(r.length)||"/",u=R({path:l.relativePath,caseSensitive:l.caseSensitive,end:o},s);if(!u)return null;Object.assign(a,u.params);let c=l.route;i.push({params:a,pathname:M([r,u.pathname]),pathnameBase:N(M([r,u.pathnameBase])),route:c}),"/"!==u.pathnameBase&&(r=M([r,u.pathnameBase]))}return i}function E(e,n){return void 0===n&&(n=[]),null==e?null:e.reduceRight(((a,r,i)=>t.createElement(l.Provider,{children:void 0!==r.route.element?r.route.element:a,value:{outlet:a,matches:n.concat(e.slice(0,i+1))}})),null)}function R(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[n,a]=function(e,t,n){void 0===t&&(t=!1);void 0===n&&(n=!0);let a=[],r="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/:(\w+)/g,((e,t)=>(a.push(t),"([^\\/]+)")));e.endsWith("*")?(a.push("*"),r+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):r+=n?"\\/*$":"(?:(?=[.~-]|%[0-9A-F]{2})|\\b|\\/|$)";return[new RegExp(r,t?void 0:"i"),a]}(e.path,e.caseSensitive,e.end),r=t.match(n);if(!r)return null;let i=r[0],l=i.replace(/(.)\/+$/,"$1"),o=r.slice(1);return{params:a.reduce(((e,t,n)=>{if("*"===t){let e=o[n]||"";l=i.slice(0,i.length-e.length).replace(/(.)\/+$/,"$1")}return e[t]=function(e,t){try{return decodeURIComponent(e)}catch(t){return e}}(o[n]||""),e}),{}),pathname:i,pathnameBase:l,pattern:e}}function S(e,t){void 0===t&&(t="/");let{pathname:a,search:r="",hash:i=""}="string"==typeof e?n.parsePath(e):e,l=a?a.startsWith("/")?a:function(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)})),n.length>1?n.join("/"):"/"}(a,t):t;return{pathname:l,search:W(r),hash:j(i)}}function $(e,t,a){let r,i="string"==typeof e?n.parsePath(e):e,l=""===e||""===i.pathname?"/":i.pathname;if(null==l)r=a;else{let e=t.length-1;if(l.startsWith("..")){let t=l.split("/");for(;".."===t[0];)t.shift(),e-=1;i.pathname=t.join("/")}r=e>=0?t[e]:"/"}let o=S(i,r);return l&&"/"!==l&&l.endsWith("/")&&!o.pathname.endsWith("/")&&(o.pathname+="/"),o}function O(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=e.charAt(t.length);return n&&"/"!==n?null:e.slice(t.length)||"/"}const M=e=>e.join("/").replace(/\/\/+/g,"/"),N=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),W=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",j=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";Object.defineProperty(e,"NavigationType",{enumerable:!0,get:function(){return n.Action}}),Object.defineProperty(e,"createPath",{enumerable:!0,get:function(){return n.createPath}}),Object.defineProperty(e,"parsePath",{enumerable:!0,get:function(){return n.parsePath}}),e.MemoryRouter=function(e){let{basename:a,children:r,initialEntries:i,initialIndex:l}=e,o=t.useRef();null==o.current&&(o.current=n.createMemoryHistory({initialEntries:i,initialIndex:l}));let u=o.current,[c,h]=t.useState({action:u.action,location:u.location});return t.useLayoutEffect((()=>u.listen(h)),[u]),t.createElement(s,{basename:a,children:r,location:c.location,navigationType:c.action,navigator:u})},e.Navigate=function(e){let{to:n,replace:r,state:i}=e;u()||a(!1);let l=h();return t.useEffect((()=>{l(n,{replace:r,state:i})})),null},e.Outlet=function(e){return f(e.context)},e.Route=o,e.Router=s,e.Routes=function(e){let{children:t,location:n}=e;return d(g(t),n)},e.UNSAFE_LocationContext=i,e.UNSAFE_NavigationContext=r,e.UNSAFE_RouteContext=l,e.createRoutesFromChildren=g,e.generatePath=function(e,t){return void 0===t&&(t={}),e.replace(/:(\w+)/g,((e,n)=>(null==t[n]&&a(!1),t[n]))).replace(/\/*\*$/,(e=>null==t["*"]?"":t["*"].replace(/^\/*/,"/")))},e.matchPath=R,e.matchRoutes=v,e.renderMatches=function(e){return E(e)},e.resolvePath=S,e.useHref=function(e){u()||a(!1);let{basename:i,navigator:l}=t.useContext(r),{hash:o,pathname:s,search:c}=m(e),h=s;if("/"!==i){let t=function(e){return""===e||""===e.pathname?"/":"string"==typeof e?n.parsePath(e).pathname:e.pathname}(e),a=null!=t&&t.endsWith("/");h="/"===s?i+(a?"/":""):M([i,s])}return l.createHref({pathname:h,search:c,hash:o})},e.useInRouterContext=u,e.useLocation=c,e.useMatch=function(e){u()||a(!1);let{pathname:n}=c();return t.useMemo((()=>R(e,n)),[n,e])},e.useNavigate=h,e.useNavigationType=function(){return t.useContext(i).navigationType},e.useOutlet=f,e.useOutletContext=function(){return t.useContext(p)},e.useParams=function(){let{matches:e}=t.useContext(l),n=e[e.length-1];return n?n.params:{}},e.useResolvedPath=m,e.useRoutes=d,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=react-router.production.min.js.map |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
456881
2990
3