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

Function parseVariables

src/main/http/import/postman.ts:238–264  ·  view source on GitHub ↗
(
  rawVariables: unknown,
  source: string,
  warnings: HttpImportWarning[],
)

Source from the content-addressed store, hash-verified

236}
237
238function parseVariables(
239 rawVariables: unknown,
240 source: string,
241 warnings: HttpImportWarning[],
242): Record<string, string> {
243 const variables: Record<string, string> = {}
244
245 for (const variable of asArray(rawVariables)) {
246 if (!isRecord(variable)) {
247 continue
248 }
249
250 const key = asString(variable.key)
251 if (!key) {
252 continue
253 }
254
255 if (variable.disabled === true || variable.enabled === false) {
256 addWarning(warnings, source, `Disabled variable "${key}" skipped`)
257 continue
258 }
259
260 variables[key] = asString(variable.value)
261 }
262
263 return variables
264}
265
266function parseEnvironment(
267 raw: UnknownRecord,

Callers 2

parseEnvironmentFunction · 0.85
parsePostmanFilesFunction · 0.85

Calls 4

addWarningFunction · 0.90
asArrayFunction · 0.70
isRecordFunction · 0.70
asStringFunction · 0.70

Tested by

no test coverage detected