n3 2.2.14 → 2.2.15

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/N3Writer.js CHANGED
@@ -77,10 +77,11 @@ class N3Writer {
77
77
  this._lineMode = false;
78
78
  this._graph = DEFAULTGRAPH;
79
79
  this._prefixIRIs = Object.create(null);
80
- options.prefixes && this.addPrefixes(options.prefixes);
81
80
  if (options.baseIRI) {
82
81
  this._baseIri = new _BaseIRI.default(options.baseIRI);
82
+ if (options.writeBase) this._write(`@base <${options.baseIRI}>.\n`);
83
83
  }
84
+ options.prefixes && this.addPrefixes(options.prefixes);
84
85
  } else {
85
86
  this._lineMode = true;
86
87
  this._writeQuad = this._writeQuadLine;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n3",
3
- "version": "2.2.14",
3
+ "version": "2.2.15",
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/N3Writer.js CHANGED
@@ -59,10 +59,12 @@ export default class N3Writer {
59
59
  this._lineMode = false;
60
60
  this._graph = DEFAULTGRAPH;
61
61
  this._prefixIRIs = Object.create(null);
62
- options.prefixes && this.addPrefixes(options.prefixes);
63
62
  if (options.baseIRI) {
64
63
  this._baseIri = new BaseIRI(options.baseIRI);
64
+ if (options.writeBase)
65
+ this._write(`@base <${options.baseIRI}>.\n`);
65
66
  }
67
+ options.prefixes && this.addPrefixes(options.prefixes);
66
68
  }
67
69
  else {
68
70
  this._lineMode = true;