Skip to content

Commit 4b7cbdc

Browse files
committed
Use ?. operation rather than && test, as per review
1 parent 7a531fe commit 4b7cbdc

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

ts/output/common/Wrapper.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -375,12 +375,14 @@ export class CommonWrapper<
375375
*/
376376
protected copySkewIC(bbox: BBox) {
377377
const first = this.childNodes[0];
378-
if (first) {
379-
first.bbox.sk && (bbox.sk = first.bbox.sk);
380-
first.bbox.dx && (bbox.dx = first.bbox.dx);
378+
if (first?.bbox.sk) {
379+
bbox.sk = first.bbox.sk;
380+
}
381+
if (first?.bbox.dx) {
382+
bbox.dx = first.bbox.dx;
381383
}
382384
const last = this.childNodes[this.childNodes.length - 1];
383-
if (last && last.bbox.ic) {
385+
if (last?.bbox.ic) {
384386
bbox.ic = last.bbox.ic;
385387
bbox.w += bbox.ic;
386388
}

0 commit comments

Comments
 (0)