(source: Source)
| 242 | * @return combined file contents, possible deliminated by boundary comments. |
| 243 | */ |
| 244 | export function squashGraphQL(source: Source): string { |
| 245 | if (!source.files || !source.files.length) { |
| 246 | return ""; |
| 247 | } |
| 248 | if (source.files.length === 1) { |
| 249 | return source.files[0].content; |
| 250 | } |
| 251 | let query = ""; |
| 252 | for (const f of source.files) { |
| 253 | if (!f.content || !/\S/.test(f.content)) { |
| 254 | continue; // Empty or space-only file. |
| 255 | } |
| 256 | query += `### Begin file ${f.path}\n`; |
| 257 | query += f.content; |
| 258 | query += `### End file ${f.path}\n`; |
| 259 | } |
| 260 | return query; |
| 261 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…