Skip to content

Commit

Permalink
chore: fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jeswr committed Sep 6, 2024
1 parent ae500ad commit 78932b4
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions src/N3Store.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,15 @@ function merge(target, source, depth = 4) {
}

function intersect(s1, s2, depth = 4) {
let target = null;
let target = false;

for (const key in s1) {
if (key in s2) {
let intersection = null;
if (depth > 0) {
intersection = intersect(s1[key], s2[key], depth - 1);
if (intersection === null)
continue;
const intersection = depth === 0 ? null : intersect(s1[key], s2[key], depth - 1);
if (intersection !== false) {
target = target || Object.create(null);
target[key] = intersection;
}

target = target || Object.create(null);
target[key] = intersection;
}
}

Expand Down Expand Up @@ -922,7 +918,8 @@ export default class N3Store {
store._graphs = merge(Object.create(null), this._graphs);
store._size = this._size;
return store;
} else if ((other instanceof N3Store) && this._entityIndex === other._entityIndex) {
}
else if ((other instanceof N3Store) && this._entityIndex === other._entityIndex) {
const store = new N3Store({ entityIndex: this._entityIndex });
store._graphs = intersect(other._graphs, this._graphs);
store._size = null;
Expand Down

0 comments on commit 78932b4

Please sign in to comment.