MCPcopy Create free account
hub / github.com/ecomfe/tempad-dev / getEventName

Function getEventName

packages/extension/utils/component.ts:309–323  ·  view source on GitHub ↗
(key: string)

Source from the content-addressed store, hash-verified

307const EVENT_HANDLER_RE = /^on[A-Z]/
308
309function getEventName(key: string) {
310 if (EVENT_HANDLER_RE.test(key)) {
311 return key[2].toLowerCase() + key.slice(3)
312 }
313
314 if (key.startsWith('@')) {
315 return key.slice(1)
316 }
317
318 if (key.startsWith('v-on:')) {
319 return key.slice(5)
320 }
321
322 return null
323}
324
325function stringifyVueComponent(
326 component: DevComponent,

Callers 1

stringifyVueComponentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected