n3 2.13.7 → 2.13.8

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.
@@ -53,8 +53,9 @@ class Term {
53
53
  // ### Returns whether this object represents the same term as the other
54
54
  equals(other) {
55
55
  // If both terms were created by this library,
56
- // equality can be computed through ids
57
- if (other instanceof Term) return this.id === other.id;
56
+ // equality can be computed through ids of the same term type,
57
+ // since IRIs such as `?x` have the same id as other terms
58
+ if (other instanceof Term) return this.id === other.id && this.termType === other.termType;
58
59
  // Otherwise, compare term type and value
59
60
  return !!other && this.termType === other.termType && this.value === other.value;
60
61
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n3",
3
- "version": "2.13.7",
3
+ "version": "2.13.8",
4
4
  "description": "Lightning fast, asynchronous, streaming Turtle / N3 / RDF library.",
5
5
  "author": "Ruben Verborgh <ruben.verborgh@gmail.com>",
6
6
  "keywords": [
@@ -41,9 +41,10 @@ export class Term {
41
41
  // ### Returns whether this object represents the same term as the other
42
42
  equals(other) {
43
43
  // If both terms were created by this library,
44
- // equality can be computed through ids
44
+ // equality can be computed through ids of the same term type,
45
+ // since IRIs such as `?x` have the same id as other terms
45
46
  if (other instanceof Term)
46
- return this.id === other.id;
47
+ return this.id === other.id && this.termType === other.termType;
47
48
  // Otherwise, compare term type and value
48
49
  return !!other && this.termType === other.termType &&
49
50
  this.value === other.value;