File .deepsource.toml
not found in the default branch of the repository root. Please refer to the docs.
111 {metric.metric_type === "stateful" && (
112 <p>
113 <b className="mr-2">Event Type:</b>
114 {!!metric.event_type ? <Tag>{metric.event_type}</Tag> : "N/A"}115 </p>
116 )}
117 </div>
101 {metric.metric_type === "rate" && (
102 <p>
103 <b className="mr-2">Aggregation Type:</b>
104 {!!metric.billable_aggregation_type ? (105 <Tag>{metric.billable_aggregation_type}</Tag>106 ) : (107 "N/A"108 )}109 </p>
110 )}
111 {metric.metric_type === "stateful" && (
64 return (
65 <div>
66 <h2 className="mb-2 pb-4 pt-4 font-bold text-main">Credit Balance</h2>
67 {!!balanceAdjustments?.length ? (68 <Table69 columns={columns}70 dataSource={balanceAdjustments}71 pagination={{ pageSize: 10 }}72 />73 ) : (74 <p>No Credit Items Found</p>75 )}76 </div>
77 );
78};
In contexts such as an if
statement's test where the result of the expression will already be coerced to a Boolean
, casting to a Boolean
via double negation (!!
) or a Boolean
call is unnecessary.
const cond = !!!isPresent;
const cond2 = Boolean(!!isPresent);
if (!!cond) {
// ...
}
if (Boolean(cond2)) {
// ...
}
while (!!cond3) {
// ...
}
do {
// ...
} while (Boolean(cond));
for (; !!cond; ) {
// ...
}
const cond = !!isPresent;
const cond2 = Boolean(isPresent);
function checkCond() {
return !!isPresent;
}
const cond3 = !!(isPresent ? flag : flag2);