diff --git a/src/components/SiderMenu/SiderMenu.js b/src/components/SiderMenu/SiderMenu.js index 9b7300f9dfd1588dac45f517fc3e607384ac6c06..f1b44f553c7c812de6c17b7359a4b4064cb3c2e3 100644 --- a/src/components/SiderMenu/SiderMenu.js +++ b/src/components/SiderMenu/SiderMenu.js @@ -28,13 +28,14 @@ const getIcon = icon => { * @param menu */ export const getFlatMenuKeys = menu => - menu.reduce((keys, item) => { - keys.push(item.path); - if (item.children) { - return keys.concat(getFlatMenuKeys(item.children)); - } - return keys; - }, []); + menu + .reduce((keys, item) => { + keys.push(item.path); + if (item.children) { + return keys.concat(getFlatMenuKeys(item.children)); + } + return keys; + }, []); /** * Find all matched menu keys based on paths @@ -42,11 +43,11 @@ export const getFlatMenuKeys = menu => * @param paths: [/abc, /abc/11, /abc/11/info] */ export const getMeunMatchKeys = (flatMenuKeys, paths) => - paths.reduce( - (matchKeys, path) => - matchKeys.concat(flatMenuKeys.filter(item => pathToRegexp(item).test(path))), - [] - ); + paths + .reduce((matchKeys, path) => ( + matchKeys.concat( + flatMenuKeys.filter(item => pathToRegexp(item).test(path)) + )), []); export default class SiderMenu extends PureComponent { constructor(props) {