n3 2.6.0 → 2.6.1
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/README.md +1 -1
- package/browser/n3.esm.min.js +12 -12
- package/browser/n3.min.js +39 -1
- package/lib/N3Lexer.js +5 -5
- package/package.json +9 -7
- package/src/N3Lexer.js +5 -5
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
519
|
+
return input.startsWith('\ufeff') ? input.slice(1) : input;
|
|
520
520
|
}
|
|
521
521
|
|
|
522
522
|
// ## Public methods
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "n3",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.1",
|
|
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
|
-
|
|
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:
|
|
56
|
-
"build:browser:
|
|
57
|
-
"build:browser:esm": "node scripts/build-
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
528
|
+
return input.startsWith('\ufeff') ? input.slice(1) : input;
|
|
529
529
|
}
|
|
530
530
|
|
|
531
531
|
// ## Public methods
|