我正在做这样的检查:
check(param, { x: Number, y: Number, x2: Number, y2: Number, w: Number, h: Number });
但param
也可能是false
。我应该怎么做检查?
答案 0 :(得分:0)
来自docs:
check(param, Match.OneOf(Boolean, { x: Number, y: Number, x2: Number, y2: Number, w: Number, h: Number }));