rdflib 2.3.2 → 2.3.3-4cf323a1
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/dist/rdflib.min.js +1 -1
- package/dist/rdflib.min.js.map +1 -1
- package/esm/fetcher.js +11 -2
- package/esm/n3parser.js +1 -2
- package/lib/fetcher.js +11 -2
- package/lib/n3parser.js +1 -2
- package/package.json +1 -1
- package/src/fetcher.ts +11 -2
- package/src/n3parser.js +1 -2
package/esm/fetcher.js
CHANGED
|
@@ -475,10 +475,19 @@ export default class Fetcher {
|
|
|
475
475
|
this.timeout = options.timeout || 30000;
|
|
476
476
|
|
|
477
477
|
// solidFetcher is deprecated
|
|
478
|
-
|
|
479
|
-
if (!
|
|
478
|
+
let fetchFunc = options.fetch || typeof global !== 'undefined' && (global.solidFetcher || global.solidFetch) || typeof window !== 'undefined' && (window.solidFetcher || window.solidFetch) || crossFetch;
|
|
479
|
+
if (!fetchFunc) {
|
|
480
480
|
throw new Error('No _fetch function available for Fetcher');
|
|
481
481
|
}
|
|
482
|
+
// Bind fetch to its context to avoid "Illegal invocation" errors
|
|
483
|
+
// Check if it's the native browser fetch or global fetch that needs binding
|
|
484
|
+
if (typeof window !== 'undefined' && fetchFunc === window.fetch) {
|
|
485
|
+
this._fetch = fetchFunc.bind(window);
|
|
486
|
+
} else if (typeof global !== 'undefined' && fetchFunc === global.fetch) {
|
|
487
|
+
this._fetch = fetchFunc.bind(global);
|
|
488
|
+
} else {
|
|
489
|
+
this._fetch = fetchFunc;
|
|
490
|
+
}
|
|
482
491
|
// This is the name of the graph we store all the HTTP metadata in
|
|
483
492
|
this.appNode = this.store.sym('chrome://TheCurrentSession');
|
|
484
493
|
// this.appNode = this.store.rdfFactory.blankNode() // Needs to have a URI in tests
|
package/esm/n3parser.js
CHANGED
|
@@ -588,8 +588,7 @@ export class SinkParser {
|
|
|
588
588
|
while ("!^.".indexOf(str.slice(j, j + 1)) >= 0) {
|
|
589
589
|
var ch = str.slice(j, j + 1);
|
|
590
590
|
if (ch == ".") {
|
|
591
|
-
|
|
592
|
-
if (!ahead || _notNameChars.indexOf(ahead) >= 0 && ":?<[{(".indexOf(ahead) < 0) {
|
|
591
|
+
if (dotTerminatesName(str, j)) {
|
|
593
592
|
break;
|
|
594
593
|
}
|
|
595
594
|
}
|
package/lib/fetcher.js
CHANGED
|
@@ -484,10 +484,19 @@ class Fetcher {
|
|
|
484
484
|
this.timeout = options.timeout || 30000;
|
|
485
485
|
|
|
486
486
|
// solidFetcher is deprecated
|
|
487
|
-
|
|
488
|
-
if (!
|
|
487
|
+
let fetchFunc = options.fetch || typeof global !== 'undefined' && (global.solidFetcher || global.solidFetch) || typeof window !== 'undefined' && (window.solidFetcher || window.solidFetch) || _crossFetch.default;
|
|
488
|
+
if (!fetchFunc) {
|
|
489
489
|
throw new Error('No _fetch function available for Fetcher');
|
|
490
490
|
}
|
|
491
|
+
// Bind fetch to its context to avoid "Illegal invocation" errors
|
|
492
|
+
// Check if it's the native browser fetch or global fetch that needs binding
|
|
493
|
+
if (typeof window !== 'undefined' && fetchFunc === window.fetch) {
|
|
494
|
+
this._fetch = fetchFunc.bind(window);
|
|
495
|
+
} else if (typeof global !== 'undefined' && fetchFunc === global.fetch) {
|
|
496
|
+
this._fetch = fetchFunc.bind(global);
|
|
497
|
+
} else {
|
|
498
|
+
this._fetch = fetchFunc;
|
|
499
|
+
}
|
|
491
500
|
// This is the name of the graph we store all the HTTP metadata in
|
|
492
501
|
this.appNode = this.store.sym('chrome://TheCurrentSession');
|
|
493
502
|
// this.appNode = this.store.rdfFactory.blankNode() // Needs to have a URI in tests
|
package/lib/n3parser.js
CHANGED
|
@@ -596,8 +596,7 @@ class SinkParser {
|
|
|
596
596
|
while ("!^.".indexOf(str.slice(j, j + 1)) >= 0) {
|
|
597
597
|
var ch = str.slice(j, j + 1);
|
|
598
598
|
if (ch == ".") {
|
|
599
|
-
|
|
600
|
-
if (!ahead || _notNameChars.indexOf(ahead) >= 0 && ":?<[{(".indexOf(ahead) < 0) {
|
|
599
|
+
if (dotTerminatesName(str, j)) {
|
|
601
600
|
break;
|
|
602
601
|
}
|
|
603
602
|
}
|
package/package.json
CHANGED
package/src/fetcher.ts
CHANGED
|
@@ -756,13 +756,22 @@ export default class Fetcher implements CallbackifyInterface {
|
|
|
756
756
|
this.timeout = options.timeout || 30000
|
|
757
757
|
|
|
758
758
|
// solidFetcher is deprecated
|
|
759
|
-
|
|
759
|
+
let fetchFunc = options.fetch
|
|
760
760
|
|| (typeof global !== 'undefined' && (global.solidFetcher || global.solidFetch))
|
|
761
761
|
|| (typeof window !== 'undefined' && (window.solidFetcher || window.solidFetch))
|
|
762
762
|
|| crossFetch
|
|
763
|
-
if (!
|
|
763
|
+
if (!fetchFunc) {
|
|
764
764
|
throw new Error('No _fetch function available for Fetcher')
|
|
765
765
|
}
|
|
766
|
+
// Bind fetch to its context to avoid "Illegal invocation" errors
|
|
767
|
+
// Check if it's the native browser fetch or global fetch that needs binding
|
|
768
|
+
if (typeof window !== 'undefined' && fetchFunc === window.fetch) {
|
|
769
|
+
this._fetch = fetchFunc.bind(window)
|
|
770
|
+
} else if (typeof global !== 'undefined' && fetchFunc === global.fetch) {
|
|
771
|
+
this._fetch = fetchFunc.bind(global)
|
|
772
|
+
} else {
|
|
773
|
+
this._fetch = fetchFunc
|
|
774
|
+
}
|
|
766
775
|
// This is the name of the graph we store all the HTTP metadata in
|
|
767
776
|
this.appNode = this.store.sym('chrome://TheCurrentSession')
|
|
768
777
|
// this.appNode = this.store.rdfFactory.blankNode() // Needs to have a URI in tests
|
package/src/n3parser.js
CHANGED
|
@@ -649,8 +649,7 @@ export class SinkParser {
|
|
|
649
649
|
while (("!^.".indexOf(str.slice( j, ( j + 1 ) )) >= 0)) {
|
|
650
650
|
var ch = str.slice( j, ( j + 1 ) )
|
|
651
651
|
if ((ch == ".")) {
|
|
652
|
-
|
|
653
|
-
if (!(ahead) || (_notNameChars.indexOf(ahead) >= 0) && (":?<[{(".indexOf(ahead) < 0)) {
|
|
652
|
+
if (dotTerminatesName(str, j)) {
|
|
654
653
|
break
|
|
655
654
|
}
|
|
656
655
|
}
|