MCPcopy Create free account
hub / github.com/ProtonDriveApps/sdk / parseKeyValuePairs

Function parseKeyValuePairs

cli/src/api/apiRequirements.ts:102–123  ·  view source on GitHub ↗
(raw: string)

Source from the content-addressed store, hash-verified

100}
101
102function parseKeyValuePairs(raw: string): Map<string, string> {
103 const out = new Map<string, string>();
104 for (const token of raw.trim().split(/\s+/).filter(Boolean)) {
105 const split = token.split('=');
106 if (split.length !== 2) {
107 continue;
108 }
109
110 const key = split[0].trim().toLowerCase();
111 if (!key) {
112 continue;
113 }
114
115 const value = split[1].trim();
116 if (!value) {
117 continue;
118 }
119
120 out.set(key, value);
121 }
122 return out;
123}
124
125function compareSemverLoose(a: string, b: string): number | null {
126 const pa = parseSemverParts(a);

Callers 2

Calls 1

filterMethod · 0.80

Tested by

no test coverage detected