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

Method loadSettings

src/utils/settings.ts:51–66  ·  view source on GitHub ↗
(path: string, fileType: SettingsFileTypes)

Source from the content-addressed store, hash-verified

49 }
50
51 public static loadSettings(path: string, fileType: SettingsFileTypes) {
52 logger('loading settings from %s', path)
53
54 switch (fileType) {
55 case SettingsFileTypes.json: {
56 logger.warn('settings.json is deprecated, please use a yaml file based on resources/default-settings.yaml')
57 return SettingsStatic.loadAndParseJsonFile(path)
58 }
59 case SettingsFileTypes.yaml: {
60 return SettingsStatic.loadAndParseYamlFile(path)
61 }
62 default: {
63 throw new Error('settings file was missing or did not contain .yaml or .json extensions.')
64 }
65 }
66 }
67
68 public static createSettings(): Settings {
69 if (SettingsStatic._settings) {

Callers 2

settings.spec.tsFile · 0.80
createSettingsMethod · 0.80

Calls 2

loadAndParseJsonFileMethod · 0.80
loadAndParseYamlFileMethod · 0.80

Tested by

no test coverage detected