MCPcopy Create free account
hub / github.com/angular/components / normalizeUnits

Function normalizeUnits

src/material/grid-list/tile-styler.ts:305–307  ·  view source on GitHub ↗

Appends pixels to a CSS string if no units are given.

(value: string)

Source from the content-addressed store, hash-verified

303
304/** Appends pixels to a CSS string if no units are given. */
305function normalizeUnits(value: string): string {
306 return value.match(/([A-Za-z%]+)$/) ? value : `${value}px`;
307}

Callers 2

initFunction · 0.85
initMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected