(str: string)
| 920 | } |
| 921 | |
| 922 | function toStyleMap(str: string): Map<string, string> { |
| 923 | const styleMap: Map<string, string> = new Map() |
| 924 | for (const item of str.split(';')) { |
| 925 | let [key, value] = item.split(':') |
| 926 | key = key.trim() |
| 927 | value = value && value.trim() |
| 928 | if (key && value) { |
| 929 | styleMap.set(key, value) |
| 930 | } |
| 931 | } |
| 932 | return styleMap |
| 933 | } |
| 934 | |
| 935 | function isMapEqual(a: Map<string, string>, b: Map<string, string>): boolean { |
| 936 | if (a.size !== b.size) { |