MCPcopy
hub / github.com/AndrewWalsh/openapi-devtools / entriesToJSONType

Function entriesToJSONType

src/utils/helpers.ts:65–73  ·  view source on GitHub ↗
(
  entries: Array<{ name: string; value: string }>
)

Source from the content-addressed store, hash-verified

63 `${DEFAULT_PARAM_NAME}${index}`;
64
65export const entriesToJSONType = (
66 entries: Array<{ name: string; value: string }>
67): JSONType => {
68 if (!entries || !entries.length) return null;
69 return entries.reduce((acc, { name, value }) => {
70 acc[name] = value;
71 return acc;
72 }, {} as { [k: string]: string });
73};
74
75export const parseJSON = (json?: string): JSONType => {
76 if (!json) return null;

Callers 1

createLeafFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected