17 lines
438 B
TypeScript
17 lines
438 B
TypeScript
import * as yaml from "js-yaml";
|
|
import type { ProjectConfig } from "@/model/projectConfig";
|
|
|
|
export function serializeProjectConfig(config: ProjectConfig): string {
|
|
const data: Record<string, unknown> = { tags: config.tags };
|
|
if (config.shownHiddenColumns.length > 0) {
|
|
data.shownHiddenColumns = config.shownHiddenColumns;
|
|
}
|
|
return yaml
|
|
.dump(data, {
|
|
lineWidth: -1,
|
|
forceQuotes: false,
|
|
})
|
|
.trimEnd()
|
|
.concat("\n");
|
|
}
|