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

Function isMismatchAllowedByAttr

packages/runtime-core/src/hydration.ts:1007–1023  ·  view source on GitHub ↗
(
  allowedAttr: string | null,
  allowedType: MismatchTypes,
)

Source from the content-addressed store, hash-verified

1005}
1006
1007function isMismatchAllowedByAttr(
1008 allowedAttr: string | null,
1009 allowedType: MismatchTypes,
1010): boolean {
1011 if (allowedAttr == null) {
1012 return false
1013 } else if (allowedAttr === '') {
1014 return true
1015 } else {
1016 const list = allowedAttr.split(',')
1017 // text is a subset of children
1018 if (allowedType === MismatchTypes.TEXT && list.includes('children')) {
1019 return true
1020 }
1021 return list.includes(MismatchTypeString[allowedType])
1022 }
1023}
1024
1025function isNodeMismatchAllowed(node: Node, vnode: VNode): boolean {
1026 return (

Callers 3

isMismatchAllowedFunction · 0.85
isMismatchAllowedByNodeFunction · 0.85
isMismatchAllowedByVNodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected