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

Function getKeyValueArrayValue

src/main/http/import/postman.ts:78–93  ·  view source on GitHub ↗
(
  value: unknown,
  key: string,
)

Source from the content-addressed store, hash-verified

76}
77
78function getKeyValueArrayValue(
79 value: unknown,
80 key: string,
81): string | undefined {
82 for (const entry of asArray(value)) {
83 if (!isRecord(entry)) {
84 continue
85 }
86
87 if (entry.key === key && typeof entry.value === 'string') {
88 return entry.value
89 }
90 }
91
92 return undefined
93}
94
95function parseAuth(
96 rawAuth: unknown,

Callers 1

parseAuthFunction · 0.85

Calls 2

asArrayFunction · 0.70
isRecordFunction · 0.70

Tested by

no test coverage detected