Skip to content

Commit

Permalink
return early
Browse files Browse the repository at this point in the history
Signed-off-by: John Cowen <[email protected]>
  • Loading branch information
johncowen committed Dec 5, 2024
1 parent 0b81993 commit 3ec192c
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions packages/kuma-gui/src/app/application/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,22 +103,23 @@ const addPath = (item: RouteRecordRaw, parent?: RouteRecordRaw) => {
}
}
const addRouteName = (item: RouteRecordRaw) => {
if (typeof item.name !== 'undefined') {
const props = ((props) => {
switch (true) {
case typeof props === 'function':
return props
case typeof props === 'undefined':
return () => ({})
default:
return () => props
}
})(item.props)
item.props = (...args) => {
return {
...props(...args),
routeName: item.name,
}
if (typeof item.name === 'undefined') {
return
}
const props = ((props) => {
switch (true) {
case typeof props === 'function':
return props
case typeof props === 'undefined':
return () => ({})
default:
return () => props
}
})(item.props)
item.props = (...args) => {
return {
...props(...args),
routeName: item.name,
}
}
}
Expand Down

0 comments on commit 3ec192c

Please sign in to comment.