MCPcopy
hub / github.com/youzan/vant-weapp / addUnit

Function addUnit

packages/common/utils.ts:25–32  ·  view source on GitHub ↗
(value?: string | number)

Source from the content-addressed store, hash-verified

23}
24
25export function addUnit(value?: string | number): string | undefined {
26 if (!isDef(value)) {
27 return undefined;
28 }
29
30 value = String(value);
31 return isNumber(value) ? `${value}px` : value;
32}
33
34export function requestAnimationFrame(cb: () => void) {
35 return setTimeout(() => {

Callers 2

getChildWrapperStyleFunction · 0.90
updateValueFunction · 0.90

Calls 2

isDefFunction · 0.90
isNumberFunction · 0.90

Tested by

no test coverage detected