n3 2.7.3 → 2.7.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/N3Store.js CHANGED
@@ -278,12 +278,15 @@ class N3Store {
278
278
  // A null key list stops after visiting a bound key, avoiding a one-item array.
279
279
  const keys0 = key0 ? null : Object.keys(index0);
280
280
  for (let i0 = 0, value0 = key0 || keys0[0]; value0; value0 = keys0 && keys0[++i0]) {
281
+ // Mutations can remove keys captured before an earlier yield.
281
282
  const index1 = index0[value0];
283
+ if (!index1) continue; // eslint-disable-line no-continue
282
284
  parts[name0] = this._termFromId(entityKeys[value0]);
283
285
  if (key1 && !(key1 in index1)) return;
284
286
  const keys1 = key1 ? null : Object.keys(index1);
285
287
  for (let i1 = 0, value1 = key1 || keys1[0]; value1; value1 = keys1 && keys1[++i1]) {
286
288
  const index2 = index1[value1];
289
+ if (!index2) continue; // eslint-disable-line no-continue
287
290
  parts[name1] = this._termFromId(entityKeys[value1]);
288
291
  const values = Object.keys(index2);
289
292
  for (let l = 0; l < values.length; l++) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n3",
3
- "version": "2.7.3",
3
+ "version": "2.7.4",
4
4
  "description": "Lightning fast, asynchronous, streaming Turtle / N3 / RDF library.",
5
5
  "author": "Ruben Verborgh <ruben.verborgh@gmail.com>",
6
6
  "keywords": [
package/src/N3Store.js CHANGED
@@ -297,7 +297,9 @@ export default class N3Store {
297
297
  const keys0 = key0 ? null : Object.keys(index0);
298
298
  for (let i0 = 0, value0 = key0 || keys0[0]; value0;
299
299
  value0 = keys0 && keys0[++i0]) {
300
+ // Mutations can remove keys captured before an earlier yield.
300
301
  const index1 = index0[value0];
302
+ if (!index1) continue; // eslint-disable-line no-continue
301
303
  parts[name0] = this._termFromId(entityKeys[value0]);
302
304
 
303
305
  if (key1 && !(key1 in index1))
@@ -306,6 +308,7 @@ export default class N3Store {
306
308
  for (let i1 = 0, value1 = key1 || keys1[0]; value1;
307
309
  value1 = keys1 && keys1[++i1]) {
308
310
  const index2 = index1[value1];
311
+ if (!index2) continue; // eslint-disable-line no-continue
309
312
  parts[name1] = this._termFromId(entityKeys[value1]);
310
313
  const values = Object.keys(index2);
311
314
  for (let l = 0; l < values.length; l++) {