MCPcopy Create free account
hub / github.com/cameri/nostream / formatCurrentValue

Function formatCurrentValue

src/cli/tui/menus/configure.ts:141–163  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

139]
140
141const formatCurrentValue = (value: unknown): string => {
142 if (Array.isArray(value)) {
143 return value.length === 0 ? '[]' : value.join(', ')
144 }
145
146 if (typeof value === 'string') {
147 return value
148 }
149
150 if (value === undefined) {
151 return 'undefined'
152 }
153
154 if (value === null) {
155 return 'null'
156 }
157
158 if (typeof value === 'object') {
159 return JSON.stringify(value)
160 }
161
162 return String(value)
163}
164
165const getGuidedSettingValue = async (setting: GuidedSetting, currentValue: unknown) => {
166 switch (setting.type) {

Callers 2

getGuidedSettingValueFunction · 0.85
runGuidedConfigureMenuFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected