MCPcopy
hub / github.com/barvian/fluid-tailwind / parse

Method parse

packages/fluid-tailwind/src/util/css.ts:20–28  ·  view source on GitHub ↗
(raw: unknown)

Source from the content-addressed store, hash-verified

18 return `${this.number}${this.unit ?? ''}`
19 }
20 static parse(raw: unknown) {
21 if (raw === 0) return new this(0)
22 if (typeof raw !== 'string') return null
23 if (parseFloat(raw) === 0) return new this(0)
24
25 const match = raw.match(lengthRegExp)
26 const number = parseFloat(match?.[1] ?? '')
27 return isNaN(number) ? null : new this(number, match?.[2])
28 }
29}

Callers 5

addFluidFunction · 0.80
fluidPluginFunction · 0.80
index.tsFile · 0.80
filterBreakpointsFunction · 0.80
lengthFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected