MCPcopy Create free account
hub / github.com/SethGammon/Citadel / extractDirection

Function extractDirection

scripts/dashboard.js:133–152  ·  view source on GitHub ↗
(content)

Source from the content-addressed store, hash-verified

131 return `${diffDays} day${diffDays === 1 ? '' : 's'} ago`;
132}
133
134function extractDirection(content) {
135 const lines = content.split(/\r?\n/);
136 for (let index = 0; index < lines.length; index++) {
137 const match = lines[index].match(/^\s*(?:\*\*)?Direction:(?:\*\*)?\s*(.*)$/i);
138 if (!match) continue;
139
140 const parts = [];
141 if (match[1]) parts.push(match[1].trim());
142
143 for (let next = index + 1; next < lines.length; next++) {
144 const line = lines[next];
145 if (!line.trim()) break;
146 if (/^#/.test(line) || /^[A-Z][A-Za-z ]+:/.test(line)) break;
147 parts.push(line.trim());
148 }
149
150 return parts.join(' ').trim();
151 }
152 return '';
153}
154
155function normalizeStatus(campaign) {

Callers 1

readCampaignsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected