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

Function parseStringStyle

packages/shared/src/normalizeProp.ts:31–43  ·  view source on GitHub ↗
(cssText: string)

Source from the content-addressed store, hash-verified

29const styleCommentRE = /\/\*[^]*?\*\//g
30
31export 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
45export function stringifyStyle(
46 styles: NormalizedStyle | string | undefined,

Callers 3

parseInlineCSSFunction · 0.90
normalizeStyleFunction · 0.85

Calls 1

forEachMethod · 0.80

Tested by

no test coverage detected