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 => { ...@@ -28,7 +28,8 @@ const getIcon = icon => {
* @param menu * @param menu
*/ */
export const getFlatMenuKeys = menu => export const getFlatMenuKeys = menu =>
menu.reduce((keys, item) => { menu
.reduce((keys, item) => {
keys.push(item.path); keys.push(item.path);
if (item.children) { if (item.children) {
return keys.concat(getFlatMenuKeys(item.children)); return keys.concat(getFlatMenuKeys(item.children));
...@@ -42,11 +43,11 @@ export const getFlatMenuKeys = menu => ...@@ -42,11 +43,11 @@ export const getFlatMenuKeys = menu =>
* @param paths: [/abc, /abc/11, /abc/11/info] * @param paths: [/abc, /abc/11, /abc/11/info]
*/ */
export const getMeunMatchKeys = (flatMenuKeys, paths) => export const getMeunMatchKeys = (flatMenuKeys, paths) =>
paths.reduce( paths
(matchKeys, path) => .reduce((matchKeys, path) => (
matchKeys.concat(flatMenuKeys.filter(item => pathToRegexp(item).test(path))), matchKeys.concat(
[] flatMenuKeys.filter(item => pathToRegexp(item).test(path))
); )), []);
export default class SiderMenu extends PureComponent { export default class SiderMenu extends PureComponent {
constructor(props) { 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