n3 2.6.0 → 2.6.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/N3Lexer.js CHANGED
@@ -131,12 +131,12 @@ class N3Lexer {
131
131
  // Try to find a comment
132
132
  if (this.comments && (comment = this._comment.exec(whiteSpaceMatch[0]))) emitToken('comment', comment[1], '', this._line, whiteSpaceMatch[0].length);
133
133
  // Advance the input
134
- input = input.substr(whiteSpaceMatch[0].length, input.length);
134
+ input = input.slice(whiteSpaceMatch[0].length);
135
135
  currentLineLength = input.length;
136
136
  this._line++;
137
137
  }
138
138
  // Skip whitespace on current line
139
- if (!whiteSpaceMatch && (whiteSpaceMatch = this._whitespace.exec(input))) input = input.substr(whiteSpaceMatch[0].length, input.length);
139
+ if (!whiteSpaceMatch && (whiteSpaceMatch = this._whitespace.exec(input))) input = input.slice(whiteSpaceMatch[0].length);
140
140
 
141
141
  // Stop for now if we're at the end
142
142
  if (this._endOfFile.test(input)) {
@@ -167,7 +167,7 @@ class N3Lexer {
167
167
  else if (input[1] === '^') {
168
168
  this._previousMarker = '^^';
169
169
  // Move to type IRI or prefixed name
170
- input = input.substr(2);
170
+ input = input.slice(2);
171
171
  if (input[0] !== '<') {
172
172
  inconclusive = true;
173
173
  break;
@@ -406,7 +406,7 @@ class N3Lexer {
406
406
  this._previousMarker = type;
407
407
 
408
408
  // Advance to next part to tokenize
409
- input = input.substr(length, input.length);
409
+ input = input.slice(length);
410
410
  }
411
411
 
412
412
  // Emits the token through the callback
@@ -516,7 +516,7 @@ class N3Lexer {
516
516
 
517
517
  // ### Strips off any starting UTF BOM mark.
518
518
  _readStartingBom(input) {
519
- return input.startsWith('\ufeff') ? input.substr(1) : input;
519
+ return input.startsWith('\ufeff') ? input.slice(1) : input;
520
520
  }
521
521
 
522
522
  // ## Public methods
package/lib/N3Store.js CHANGED
@@ -1085,10 +1085,9 @@ class N3Store {
1085
1085
  }
1086
1086
 
1087
1087
  // ### Store is an iterable.
1088
- // Can be used where iterables are expected: for...of loops, array spread operator,
1089
- // `yield*`, and destructuring assignment (order is not guaranteed).
1090
- *[Symbol.iterator]() {
1091
- yield* this.readQuads();
1088
+ // Returns the quad iterator directly; order is not guaranteed.
1089
+ [Symbol.iterator]() {
1090
+ return this.readQuads();
1092
1091
  }
1093
1092
  }
1094
1093
 
@@ -1267,7 +1266,7 @@ class DatasetCoreAndReadableStream extends _readableStream.Readable {
1267
1266
  match(subject, predicate, object, graph) {
1268
1267
  return new DatasetCoreAndReadableStream(this.filtered, subject, predicate, object, graph, this.options);
1269
1268
  }
1270
- *[Symbol.iterator]() {
1271
- yield* this._filtered || this.n3Store.readQuads(this.subject, this.predicate, this.object, this.graph);
1269
+ [Symbol.iterator]() {
1270
+ return this._filtered ? this._filtered[Symbol.iterator]() : this.n3Store.readQuads(this.subject, this.predicate, this.object, this.graph);
1272
1271
  }
1273
1272
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n3",
3
- "version": "2.6.0",
3
+ "version": "2.6.2",
4
4
  "description": "Lightning fast, asynchronous, streaming Turtle / N3 / RDF library.",
5
5
  "author": "Ruben Verborgh <ruben.verborgh@gmail.com>",
6
6
  "keywords": [
@@ -34,7 +34,6 @@
34
34
  "@babel/register": "^8.0.1",
35
35
  "@rdfjs/data-model": "^1",
36
36
  "arrayify-stream": "^3.0.0",
37
- "browserify": "^17.0.0",
38
37
  "deep-taxonomy-benchmark": "^2.0.0",
39
38
  "docco": "^0.9.1",
40
39
  "esbuild": "^0.28.1",
@@ -43,18 +42,21 @@
43
42
  "eslint-plugin-jest": "^29.15.0",
44
43
  "globals": "^17.6.0",
45
44
  "jest": "^30.4.2",
45
+ "playwright": "^1.61.1",
46
46
  "pre-commit": "^2.0.0",
47
47
  "rdf-isomorphic": "^2.0.0",
48
48
  "rdf-test-suite": "^2.1.4",
49
- "streamify-string": "^1.0.1",
50
- "uglify-js": "^3.14.3"
49
+ "streamify-string": "^1.0.1"
50
+ },
51
+ "overrides": {
52
+ "js-yaml": "^4.2.0"
51
53
  },
52
54
  "scripts": {
53
55
  "build": "npm run build:node && npm run build:browser",
54
56
  "build:node": "babel src -d lib",
55
- "build:browser": "rm -rf browser && mkdir browser && npm run build:browser:umd && npm run build:browser:esm",
56
- "build:browser:umd": "browserify -s N3 lib/index.js | uglifyjs > browser/n3.min.js",
57
- "build:browser:esm": "node scripts/build-esm.js",
57
+ "build:browser": "rm -rf browser && mkdir browser && npm run build:browser:iife && npm run build:browser:esm",
58
+ "build:browser:iife": "node scripts/build-browser-bundle.js iife",
59
+ "build:browser:esm": "node scripts/build-browser-bundle.js esm",
58
60
  "test": "jest",
59
61
  "lint": "eslint src perf test spec",
60
62
  "prepare": "npm run build",
package/src/N3Lexer.js CHANGED
@@ -102,13 +102,13 @@ export default class N3Lexer {
102
102
  if (this.comments && (comment = this._comment.exec(whiteSpaceMatch[0])))
103
103
  emitToken('comment', comment[1], '', this._line, whiteSpaceMatch[0].length);
104
104
  // Advance the input
105
- input = input.substr(whiteSpaceMatch[0].length, input.length);
105
+ input = input.slice(whiteSpaceMatch[0].length);
106
106
  currentLineLength = input.length;
107
107
  this._line++;
108
108
  }
109
109
  // Skip whitespace on current line
110
110
  if (!whiteSpaceMatch && (whiteSpaceMatch = this._whitespace.exec(input)))
111
- input = input.substr(whiteSpaceMatch[0].length, input.length);
111
+ input = input.slice(whiteSpaceMatch[0].length);
112
112
 
113
113
  // Stop for now if we're at the end
114
114
  if (this._endOfFile.test(input)) {
@@ -136,7 +136,7 @@ export default class N3Lexer {
136
136
  else if (input[1] === '^') {
137
137
  this._previousMarker = '^^';
138
138
  // Move to type IRI or prefixed name
139
- input = input.substr(2);
139
+ input = input.slice(2);
140
140
  if (input[0] !== '<') {
141
141
  inconclusive = true;
142
142
  break;
@@ -425,7 +425,7 @@ export default class N3Lexer {
425
425
  this._previousMarker = type;
426
426
 
427
427
  // Advance to next part to tokenize
428
- input = input.substr(length, input.length);
428
+ input = input.slice(length);
429
429
  }
430
430
 
431
431
  // Emits the token through the callback
@@ -525,7 +525,7 @@ export default class N3Lexer {
525
525
 
526
526
  // ### Strips off any starting UTF BOM mark.
527
527
  _readStartingBom(input) {
528
- return input.startsWith('\ufeff') ? input.substr(1) : input;
528
+ return input.startsWith('\ufeff') ? input.slice(1) : input;
529
529
  }
530
530
 
531
531
  // ## Public methods
package/src/N3Store.js CHANGED
@@ -1148,10 +1148,9 @@ export default class N3Store {
1148
1148
  }
1149
1149
 
1150
1150
  // ### Store is an iterable.
1151
- // Can be used where iterables are expected: for...of loops, array spread operator,
1152
- // `yield*`, and destructuring assignment (order is not guaranteed).
1153
- *[Symbol.iterator]() {
1154
- yield* this.readQuads();
1151
+ // Returns the quad iterator directly; order is not guaranteed.
1152
+ [Symbol.iterator]() {
1153
+ return this.readQuads();
1155
1154
  }
1156
1155
  }
1157
1156
 
@@ -1345,7 +1344,8 @@ class DatasetCoreAndReadableStream extends Readable {
1345
1344
  return new DatasetCoreAndReadableStream(this.filtered, subject, predicate, object, graph, this.options);
1346
1345
  }
1347
1346
 
1348
- *[Symbol.iterator]() {
1349
- yield* this._filtered || this.n3Store.readQuads(this.subject, this.predicate, this.object, this.graph);
1347
+ [Symbol.iterator]() {
1348
+ return this._filtered ? this._filtered[Symbol.iterator]() :
1349
+ this.n3Store.readQuads(this.subject, this.predicate, this.object, this.graph);
1350
1350
  }
1351
1351
  }