bool
이 페이지에서

bool()

함수, 값 분류

A bool literal node, the condition type for .select(), select() and control flow (If, While).

import { bool } from 'typeshade'

시그니처, 설명, 예제는 커밋 c66579bf의 컴파일러 소스에서 그대로 가져온 영어 원문입니다.

구문

const bool: (v: boolean) => Node<"bool">

매개변수

v boolean

반환값

Node<'bool'>

예외

TypeError

v is not a JS boolean.

설명

Only a JS boolean is accepted, so a stray bool(someNode) fails at the call site instead of coercing to true.

예제

예제

import { bool } from 'typeshade'
const flag = bool(true) // Node<'bool'>

관련 가이드

소스

src/core/ir/node.ts, 1068행, 커밋 c66579bf 기준

이 페이지 편집 문제 보고