n3 1.24.0 → 1.24.2

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
@@ -147,7 +147,7 @@ class N3Store {
147
147
  this._graphs = Object.create(null);
148
148
 
149
149
  // Shift parameters if `quads` is not given
150
- if (!options && quads && !quads[0]) options = quads, quads = null;
150
+ if (!options && quads && !quads[0] && !(typeof quads.match === 'function')) options = quads, quads = null;
151
151
  options = options || {};
152
152
  this._factory = options.factory || _N3DataFactory.default;
153
153
  this._entityIndex = options.entityIndex || new N3EntityIndex({
@@ -159,7 +159,7 @@ class N3Store {
159
159
  this._termToNewNumericId = this._entityIndex._termToNewNumericId.bind(this._entityIndex);
160
160
 
161
161
  // Add quads if passed
162
- if (quads) this.addQuads(quads);
162
+ if (quads) this.addAll(quads);
163
163
  }
164
164
 
165
165
  // ## Public properties
@@ -579,7 +579,7 @@ class N3Store {
579
579
  // and returns `true` if it returns truthy for any of them.
580
580
  // Setting any field to `undefined` or `null` indicates a wildcard.
581
581
  some(callback, subject, predicate, object, graph) {
582
- for (const quad of this.readQuads(subject, predicate, object, graph)) if (callback(quad)) return true;
582
+ for (const quad of this.readQuads(subject, predicate, object, graph)) if (callback(quad, this)) return true;
583
583
  return false;
584
584
  }
585
585
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n3",
3
- "version": "1.24.0",
3
+ "version": "1.24.2",
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
@@ -163,7 +163,7 @@ export default class N3Store {
163
163
  this._graphs = Object.create(null);
164
164
 
165
165
  // Shift parameters if `quads` is not given
166
- if (!options && quads && !quads[0])
166
+ if (!options && quads && !quads[0] && !(typeof quads.match === 'function'))
167
167
  options = quads, quads = null;
168
168
  options = options || {};
169
169
  this._factory = options.factory || N3DataFactory;
@@ -175,7 +175,7 @@ export default class N3Store {
175
175
 
176
176
  // Add quads if passed
177
177
  if (quads)
178
- this.addQuads(quads);
178
+ this.addAll(quads);
179
179
  }
180
180
 
181
181
  // ## Public properties
@@ -601,7 +601,7 @@ export default class N3Store {
601
601
  // Setting any field to `undefined` or `null` indicates a wildcard.
602
602
  some(callback, subject, predicate, object, graph) {
603
603
  for (const quad of this.readQuads(subject, predicate, object, graph))
604
- if (callback(quad))
604
+ if (callback(quad, this))
605
605
  return true;
606
606
  return false;
607
607
  }