( allowedAttr: string | null, allowedType: MismatchTypes, )
| 1005 | } |
| 1006 | |
| 1007 | function 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 | |
| 1025 | function isNodeMismatchAllowed(node: Node, vnode: VNode): boolean { |
| 1026 | return ( |
no outgoing calls
no test coverage detected