Documentation / @finchart/core / isGap
Function: isGap()
isGap(
value): value is null | undefined
Defined in: packages/core/src/data/accessors.ts:21
이 값은 갭인가 — 그릴 것이 없는 자리인가.
null이 갭이라는 것은 README가 warmup 예제로 가르치는 계약이다. undefined도 같이 본다: 거래소 행 하나에 close가 없어 undefined로 온 것과 소비자가 일부러 null을 적은 것은 화면에서 같은 뜻이다.
getY에서 ?? null로 바꾸지 않는 이유는 assertReadableValue가 getY(point) === undefined로 필드명을 틀린 소비자에게 안내를 내야 하기 때문이다 — 접근자가 undefined를 삼키면 그 안내가 영영 발화하지 않고, 소비자는 아무 말 없이 빈 차트를 본다.
Parameters
value
number | null | undefined
Returns
value is null | undefined