Skip to content

Commit

Permalink
fix: don't use null coalescing operator
Browse files Browse the repository at this point in the history
  • Loading branch information
emahuni committed Aug 2, 2022
1 parent c8d9ce3 commit 2fdb29f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function cloneObjectDeep (val, instanceClone) {
}
if (instanceClone || isPlainObject(val)) {
const res = new val.constructor();
const circulars = (whatsCircular(val) ?? []).map(c => get(val, c));
const circulars = (whatsCircular(val) || []).map(c => get(val, c));

for (let key in val) {
if (includes(circulars, val[key])) {
Expand All @@ -48,7 +48,7 @@ function cloneObjectDeep (val, instanceClone) {

function cloneArrayDeep (val, instanceClone) {
const res = new val.constructor(val.length);
const circulars = (whatsCircular(val) ?? []).map(c => get(val, c));
const circulars = (whatsCircular(val) || []).map(c => get(val, c));

for (let i = 0; i < val.length; i++) {
if (includes(circulars, val[i])) {
Expand Down

0 comments on commit 2fdb29f

Please sign in to comment.