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

Function parseEnvironment

src/main/http/import/opencollection.ts:326–342  ·  view source on GitHub ↗
(
  file: HttpImportFile,
  raw: unknown,
)

Source from the content-addressed store, hash-verified

324}
325
326function parseEnvironment(
327 file: HttpImportFile,
328 raw: unknown,
329): HttpImportEnvironment | null {
330 if (!/(?:^|\/)environments\/.+\.ya?ml$/i.test(normalizePath(file.name)))
331 return null
332 if (!isRecord(raw))
333 return null
334
335 const info = getInfo(raw)
336 const variables = parseEnvironmentVariables(raw.variables ?? raw.vars)
337
338 return {
339 name: normalizeImportName(info.name ?? raw.name, basename(file.name)),
340 variables,
341 }
342}
343
344function mergeQueryEntries(
345 urlQuery: HttpQueryEntry[],

Callers 1

parseOpenCollectionFilesFunction · 0.70

Calls 6

normalizeImportNameFunction · 0.90
normalizePathFunction · 0.85
isRecordFunction · 0.70
getInfoFunction · 0.70
basenameFunction · 0.70

Tested by

no test coverage detected