MCPcopy Index your code
hub / github.com/cameri/nostream / settingsFileType

Method settingsFileType

src/utils/settings.ts:38–49  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

36 }
37
38 public static settingsFileType(path: string): SettingsFileTypes | undefined {
39 const files: string[] = fs.readdirSync(path)
40 const filteredFile = files.find((fn) => fn.startsWith('settings'))
41 if (filteredFile) {
42 const extension = extname(filteredFile).substring(1)
43 if (SettingsFileTypes[extension]) {
44 return SettingsFileTypes[extension]
45 }
46 }
47
48 return SettingsFileTypes.yaml
49 }
50
51 public static loadSettings(path: string, fileType: SettingsFileTypes) {
52 logger('loading settings from %s', path)

Callers 2

createSettingsMethod · 0.80
watchSettingsMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected