MCPcopy Index your code
hub / github.com/massCodeIO/massCode / parseEnvironmentVariables

Function parseEnvironmentVariables

src/main/http/import/opencollection.ts:302–324  ·  view source on GitHub ↗
(raw: unknown)

Source from the content-addressed store, hash-verified

300}
301
302function parseEnvironmentVariables(raw: unknown): Record<string, string> {
303 const variables: Record<string, string> = {}
304
305 if (Array.isArray(raw)) {
306 for (const variable of raw) {
307 if (!isRecord(variable))
308 continue
309 const key = asString(variable.name ?? variable.key)
310 if (key && variable.disabled !== true) {
311 variables[key] = asString(variable.value)
312 }
313 }
314 return variables
315 }
316
317 if (isRecord(raw)) {
318 for (const [key, value] of Object.entries(raw)) {
319 variables[key] = asString(value)
320 }
321 }
322
323 return variables
324}
325
326function parseEnvironment(
327 file: HttpImportFile,

Callers 2

parseEnvironmentFunction · 0.85
parseBundledCollectionFunction · 0.85

Calls 2

isRecordFunction · 0.70
asStringFunction · 0.70

Tested by

no test coverage detected