param pathname export const queryKeysByPath = ( pathname ) : { openKey : string ; selectKey : string ; } => { const reg = /(^\/*)|(\/*$)/g ; const path = pathname . replace ( reg , '' ) ; const routes = path . split ( '/' ) ; return { openKey : routes [ 0 ] , selectKey : routes [ 1 ] || routes [ 0 ] } ; } ;