( host: Host, node: unknown, before: Readonly<Record<string, string>>, attrs: Readonly<Record<string, string>> )
| 1955 | } |
| 1956 | |
| 1957 | const patchAttrs = ( |
| 1958 | host: Host, |
| 1959 | node: unknown, |
| 1960 | before: Readonly<Record<string, string>>, |
| 1961 | attrs: Readonly<Record<string, string>> |
| 1962 | ): void => { |
| 1963 | if (sameAttrs(before, attrs)) return |
| 1964 | if (host.normalizeAttrs !== undefined) { |
| 1965 | before = host.normalizeAttrs(node, before) |
| 1966 | attrs = host.normalizeAttrs(node, attrs) |
| 1967 | } |
| 1968 | for (const name in before) { |
| 1969 | if (typeof attrs[name] !== "string") { |
| 1970 | host.setAttr(node, name, undefined, before[name]) |
| 1971 | } |
| 1972 | } |
| 1973 | for (const name in attrs) { |
| 1974 | const value = attrs[name] |
| 1975 | const previous = before[name] |
| 1976 | if (previous !== value) host.setAttr(node, name, value, previous) |
| 1977 | } |
| 1978 | } |
| 1979 | |
| 1980 | const patchProps = ( |
| 1981 | host: Host, |
no test coverage detected