MCPcopy
hub / github.com/vuejs/core / isSSRSafeAttrName

Function isSSRSafeAttrName

packages/shared/src/domAttrConfig.ts:39–48  ·  view source on GitHub ↗
(name: string)

Source from the content-addressed store, hash-verified

37const attrValidationCache: Record<string, boolean> = {}
38
39export function isSSRSafeAttrName(name: string): boolean {
40 if (attrValidationCache.hasOwnProperty(name)) {
41 return attrValidationCache[name]
42 }
43 const isUnsafe = unsafeAttrCharRE.test(name)
44 if (isUnsafe) {
45 console.error(`unsafe attribute name: ${name}`)
46 }
47 return (attrValidationCache[name] = !isUnsafe)
48}
49
50export const propsToAttrMap: Record<string, string | undefined> = {
51 acceptCharset: 'accept-charset',

Callers 2

ssrTransformElementFunction · 0.90
ssrRenderDynamicAttrFunction · 0.90

Calls 2

testMethod · 0.80
errorMethod · 0.80

Tested by

no test coverage detected