MCPcopy Create free account
hub / github.com/DimwitLabs/ode / loadConfig

Function loadConfig

src/utils/loadConfig.js:3–21  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1import yaml from 'js-yaml';
2
3export async function loadConfig() {
4 try {
5 const response = await fetch('/config.yaml');
6 if (!response.ok) {
7 throw new Error(`Failed to fetch config.yaml: ${response.statusText}`);
8 }
9
10 const yamlText = await response.text();
11 const config = yaml.load(yamlText);
12
13 const textTransformClass = config.ui.lowercase ? 'text-lowercase' : 'text-default';
14 document.body.classList.add(textTransformClass);
15
16 return config;
17 } catch (error) {
18 console.error('[config]: error loading configuration:', error);
19 throw error;
20 }
21}

Callers 8

WordsWastedFunction · 0.90
LayoutFunction · 0.90
LampToggleFunction · 0.90
NavigationFunction · 0.90
loadDataFunction · 0.90
loadPageFunction · 0.90
VolumesFunction · 0.90
resolveContentPathFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected