mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-13 11:43:31 +00:00
12 lines
373 B
TypeScript
12 lines
373 B
TypeScript
export function formatDeps(text: string): Record<string, string> {
|
|
return text
|
|
.split("\n")
|
|
.map((statement) => statement.replace("export", "").trim())
|
|
.filter((value) => !(value === "" || value.startsWith("#")))
|
|
.map((statement) => statement.split("="))
|
|
.reduce((acc, kv_pair) => {
|
|
acc[kv_pair[0]] = kv_pair[1];
|
|
return acc;
|
|
}, {});
|
|
}
|