MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / blankRazorComments

Function blankRazorComments

src/extraction/razor-script.ts:226–236  ·  view source on GitHub ↗
(source: string)

Source from the content-addressed store, hash-verified

224
225/** `source` with its `@* … *@` comments blanked, so a commented-out `<script>` is not a script. */
226export function blankRazorComments(source: string): string {
227 if (!source.includes('@*')) return source;
228 const out = source.split('');
229 for (let at = source.indexOf('@*'); at >= 0; at = source.indexOf('@*', at + 2)) {
230 const end = source.indexOf('*@', at + 2);
231 if (end < 0) break;
232 blank(out, at, end + 2);
233 at = end;
234 }
235 return out.join('');
236}
237
238/** Whether a `<script>` element's attributes leave it JavaScript: no `type`, or a JavaScript one. */
239export function isJavaScriptBlock(attrs: string): boolean {

Callers 2

processScriptBlocksMethod · 0.90

Calls 2

blankFunction · 0.70
joinMethod · 0.45

Tested by

no test coverage detected