@umijs/route-utils
Advanced tools
Comparing version 1.0.26 to 1.0.27
@@ -12,8 +12,4 @@ /** | ||
} | ||
if (item.path !== '/') { | ||
menus[item.path || item.key || '/'] = { ...item }; | ||
} | ||
else { | ||
menus[item.key || item.path || '/'] = { ...item }; | ||
} | ||
menus[item.path || item.key || '/'] = { ...item }; | ||
menus[item.key || item.path || '/'] = { ...item }; | ||
if (item.children) { | ||
@@ -20,0 +16,0 @@ menus = { ...menus, ...getFlatMenus(item.children) }; |
@@ -291,3 +291,3 @@ import getMatchMenu from './getMatchMenu'; | ||
test('test yfd layout config', () => { | ||
let openMenuItems = getMatchMenu('/bkmng/authority/my', [ | ||
const openMenuItems = getMatchMenu('/bkmng/authority/my', [ | ||
{ | ||
@@ -345,6 +345,7 @@ path: '/', | ||
]); | ||
expect(openMenuItems.length).toBe(1); | ||
expect(openMenuItems[0].path).toBe('/bkmng/authority/my'); | ||
expect(openMenuItems.length).toBe(2); | ||
expect(openMenuItems[0].path).toBe('/bkmng/authority'); | ||
expect(openMenuItems[1].path).toBe('/bkmng/authority/my'); | ||
expect(openMenuItems).toMatchSnapshot(); | ||
}); | ||
//# sourceMappingURL=getMatchMenu.test.js.map |
@@ -20,7 +20,4 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
if (item.path !== '/') { | ||
menus[item.path || item.key || '/'] = _objectSpread({}, item); | ||
} else { | ||
menus[item.key || item.path || '/'] = _objectSpread({}, item); | ||
} | ||
menus[item.path || item.key || '/'] = _objectSpread({}, item); | ||
menus[item.key || item.path || '/'] = _objectSpread({}, item); | ||
@@ -27,0 +24,0 @@ if (item.children) { |
@@ -27,7 +27,4 @@ "use strict"; | ||
if (item.path !== '/') { | ||
menus[item.path || item.key || '/'] = _objectSpread({}, item); | ||
} else { | ||
menus[item.key || item.path || '/'] = _objectSpread({}, item); | ||
} | ||
menus[item.path || item.key || '/'] = _objectSpread({}, item); | ||
menus[item.key || item.path || '/'] = _objectSpread({}, item); | ||
@@ -34,0 +31,0 @@ if (item.children) { |
{ | ||
"name": "@umijs/route-utils", | ||
"version": "1.0.26", | ||
"version": "1.0.27", | ||
"description": "Quickly process the routing of umi", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
329391
3818