mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-10-25 16:03:47 +00:00
* perf: lazy-load the low-code runtime on public app pages Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018bSzETfUb23CRRMEJdwqeS * perf: fetch the low-code runtime alongside the app payload Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018bSzETfUb23CRRMEJdwqeS --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
24 lines
608 B
TypeScript
24 lines
608 B
TypeScript
// Kept out of $lib/utils, which every page loads: `yaml` is only needed by the diff views.
|
|
import YAML from 'yaml'
|
|
|
|
function sortObjectKeys(obj: any): any {
|
|
if (obj && typeof obj === 'object' && !Array.isArray(obj)) {
|
|
const sortedObj: any = {}
|
|
Object.keys(obj)
|
|
.sort()
|
|
.forEach((key) => {
|
|
sortedObj[key] = sortObjectKeys(obj[key])
|
|
})
|
|
return sortedObj
|
|
} else if (Array.isArray(obj)) {
|
|
return obj.map((item) => sortObjectKeys(item))
|
|
} else {
|
|
return obj
|
|
}
|
|
}
|
|
|
|
export function orderedYamlStringify(obj: any) {
|
|
const sortedObj = sortObjectKeys(obj)
|
|
return YAML.stringify(sortedObj)
|
|
}
|