(cssText: string)
| 29 | const styleCommentRE = /\/\*[^]*?\*\//g |
| 30 | |
| 31 | export function parseStringStyle(cssText: string): NormalizedStyle { |
| 32 | const ret: NormalizedStyle = {} |
| 33 | cssText |
| 34 | .replace(styleCommentRE, '') |
| 35 | .split(listDelimiterRE) |
| 36 | .forEach(item => { |
| 37 | if (item) { |
| 38 | const tmp = item.split(propertyDelimiterRE) |
| 39 | tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim()) |
| 40 | } |
| 41 | }) |
| 42 | return ret |
| 43 | } |
| 44 | |
| 45 | export function stringifyStyle( |
| 46 | styles: NormalizedStyle | string | undefined, |
no test coverage detected