Function
sortByDisplayOrder
(wmap: { [key: string]: WidgetConfigType })
Source from the content-addressed store, hash-verified
| 39 | }>; |
| 40 | |
| 41 | function sortByDisplayOrder(wmap: { [key: string]: WidgetConfigType }): WidgetConfigType[] { |
| 42 | if (wmap == null) { |
| 43 | return []; |
| 44 | } |
| 45 | const wlist = Object.values(wmap); |
| 46 | wlist.sort((a, b) => { |
| 47 | return (a["display:order"] ?? 0) - (b["display:order"] ?? 0); |
| 48 | }); |
| 49 | return wlist; |
| 50 | } |
| 51 | |
| 52 | type WidgetPropsType = { |
| 53 | widget: WidgetConfigType; |
Tested by
no test coverage detected