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

Function isElementTag

src/extraction/sfc-script.ts:236–242  ·  view source on GitHub ↗
(at: number)

Source from the content-addressed store, hash-verified

234
235 /** Whether a `<script>` or `<style>` tag, opening or closing, starts at `at`. */
236 const isElementTag = (at: number): boolean => {
237 const name = source.charCodeAt(at + 1) === Ch.Slash ? at + 2 : at + 1;
238 const length = source.startsWith('script', name) ? 6 : source.startsWith('style', name) ? 5 : 0;
239 if (length === 0) return false;
240 const next = source.charCodeAt(name + length);
241 return next === Ch.Greater || next === Ch.Slash || next <= 32;
242 };
243
244 /** The offset after the quoted JavaScript string at `at`, or -1: a string ends on its own line. */
245 const stringEnd = (at: number, quote: number): number => {

Callers 1

expressionEndFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected