MCPcopy Create free account
hub / github.com/bvaughn/react-virtualized / parsePixels

Function parsePixels

lib/utils/test/scrollElement.ts:38–41  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

36 | null = null;
37
38function parsePixels(value: string): number | null {
39 const match = /^(-?\d+(?:\.\d+)?)px$/.exec(value);
40 return match ? parseFloat(match[1]) : null;
41}
42
43function getStyle(element: Element): CSSStyleDeclaration | null {
44 return element instanceof HTMLElement ? element.style : null;

Callers 3

getLayoutHeightFunction · 0.85
getLayoutTopFunction · 0.85
getBoundingClientRectFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected