mirror of
https://github.com/plankanban/planka.git
synced 2025-12-20 09:15:39 +03:00
20 lines
310 B
JavaScript
Executable File
20 lines
310 B
JavaScript
Executable File
import { matchPath } from 'react-router-dom';
|
|
|
|
export default (pathname, paths) => {
|
|
for (let i = 0; i < paths.length; i += 1) {
|
|
const match = matchPath(
|
|
{
|
|
path: paths[i],
|
|
end: true,
|
|
},
|
|
pathname,
|
|
);
|
|
|
|
if (match) {
|
|
return match;
|
|
}
|
|
}
|
|
|
|
return null;
|
|
};
|