cordo 2.5.0 → 2.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -12,8 +12,16 @@ type AllowedComponentArray
|
|
|
12
12
|
export function row(...components: AllowedComponentArray | [ AllowedComponentArray ]) {
|
|
13
13
|
if (Array.isArray(components[0]))
|
|
14
14
|
components = components[0]
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
|
|
16
|
+
return createComponent('ActionRow', ({ hirarchy, attributes }) => {
|
|
17
|
+
const rendered = renderComponentList(components as AllowedComponentArray, 'ActionRow', hirarchy, attributes)
|
|
18
|
+
.filter(Boolean)
|
|
19
|
+
if (!rendered.length)
|
|
20
|
+
return null
|
|
21
|
+
|
|
22
|
+
return {
|
|
23
|
+
type: ComponentType.ActionRow,
|
|
24
|
+
components: rendered
|
|
25
|
+
}
|
|
26
|
+
})
|
|
19
27
|
}
|
|
@@ -58,13 +58,11 @@ export namespace RoutingResolve {
|
|
|
58
58
|
|
|
59
59
|
export function getRouteFromPath(path: string, resolveRuntimeVars: boolean) {
|
|
60
60
|
const lockfile = CordoMagic.getLockfile()
|
|
61
|
-
const currentRoute = CordoMagic.getCwd()
|
|
62
61
|
const invoker = CordoMagic.getInvoker()
|
|
62
|
+
const currentRoute = CordoMagic.getCwd() ?? ''
|
|
63
63
|
|
|
64
64
|
if (!lockfile)
|
|
65
65
|
throw new MissingContextError('getRouteFromPath failed, no lockfile found in context.')
|
|
66
|
-
if (!currentRoute)
|
|
67
|
-
throw new MissingContextError('getRouteFromPath failed, no current route found in context.')
|
|
68
66
|
if (!invoker)
|
|
69
67
|
throw new MissingContextError('getRouteFromPath failed, no invoker found in context.')
|
|
70
68
|
|