Commit fad3f4ac authored by Alan Wei's avatar Alan Wei Committed by ι™ˆεΈ…

tweak code to keep coding style consistency

parent 4ddbfe6a
......@@ -28,7 +28,8 @@ const getIcon = icon => {
* @param menu
*/
export const getFlatMenuKeys = menu =>
menu.reduce((keys, item) => {
menu
.reduce((keys, item) => {
keys.push(item.path);
if (item.children) {
return keys.concat(getFlatMenuKeys(item.children));
......@@ -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) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment