MCPcopy Create free account
hub / github.com/thetarnav/solid-devtools / getLocationAttr

Function getLocationAttr

packages/debugger/src/locator/locator.ts:37–45  ·  view source on GitHub ↗
(element: Element)

Source from the content-addressed store, hash-verified

35const LOC_ATTR_REGEX_UNIX = /^((?:(?:\.\/|\.\.\/|\/)?(?:\.?\w+\/)*)(?:\.?\w+\.?\w+)):([0-9]+):([0-9]+)$/
36
37export function getLocationAttr(element: Element): LocationAttr | null {
38
39 let attr = element.getAttribute(LOCATION_ATTRIBUTE_NAME)
40 if (!attr) return null
41
42 let is_windows = /(win32|win64|windows|wince)/i.test(navigator.userAgent)
43 let regex = is_windows ? LOC_ATTR_REGEX_WIN : LOC_ATTR_REGEX_UNIX
44 return regex.test(attr) ? attr as LocationAttr : null
45}
46
47function getTargetURL(target: TargetIDE | TargetURLFunction, data: SourceCodeData): string | void {
48

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…