MCPcopy Create free account
hub / github.com/diegosouzapw/OmniRoute / parseExampleEntries

Function parseExampleEntries

scripts/dev/sync-env.mjs:153–191  ·  view source on GitHub ↗
(content, scope = "full")

Source from the content-addressed store, hash-verified

151}
152
153function parseExampleEntries(content, scope = "full") {
154 const entries = new Map();
155 const lines = content.split(/\r?\n/);
156
157 if (scope === "oauth") {
158 let inOauthSection = false;
159
160 for (const line of lines) {
161 const trimmed = line.trim();
162
163 if (/OAUTH PROVIDER CREDENTIALS/i.test(trimmed)) {
164 inOauthSection = true;
165 continue;
166 }
167
168 if (!inOauthSection) continue;
169
170 if (/Provider User-Agent Overrides/i.test(trimmed)) break;
171
172 const parsed = parseEnvEntry(line);
173 if (!parsed) continue;
174
175 const [key, value] = parsed;
176 entries.set(key, value);
177 }
178
179 return entries;
180 }
181
182 for (const line of lines) {
183 const parsed = parseEnvEntry(line);
184 if (!parsed) continue;
185
186 const [key, value] = parsed;
187 entries.set(key, value);
188 }
189
190 return entries;
191}
192
193export function getEnvSyncPlan({ rootDir, scope = "full" } = {}) {
194 const root = resolveRootDir(rootDir);

Callers 2

getEnvSyncPlanFunction · 0.85
syncEnvFunction · 0.85

Calls 2

parseEnvEntryFunction · 0.85
setMethod · 0.45

Tested by

no test coverage detected