n3 2.13.10 → 2.13.11
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 +2 -0
- package/browser/n3.esm.min.js +1 -1
- package/browser/n3.min.js +1 -1
- package/lib/N3DataFactory.js +2 -2
- package/package.json +1 -1
- package/src/N3DataFactory.js +2 -2
package/lib/N3DataFactory.js
CHANGED
|
@@ -137,10 +137,10 @@ class Literal extends Term {
|
|
|
137
137
|
|
|
138
138
|
// ### The direction of this literal
|
|
139
139
|
get direction() {
|
|
140
|
-
// Find the last double dash after the closing quote (e.g., '"abc"@en-us--ltr')
|
|
140
|
+
// Find the last double dash after the closing quote and language tag (e.g., '"abc"@en-us--ltr')
|
|
141
141
|
const id = this.id;
|
|
142
142
|
const endPos = id.lastIndexOf('"');
|
|
143
|
-
const dirPos = id.lastIndexOf('--');
|
|
143
|
+
const dirPos = id[endPos + 1] === '@' ? id.lastIndexOf('--') : -1;
|
|
144
144
|
return dirPos > endPos && dirPos + 2 < id.length ? id.substr(dirPos + 2).toLowerCase() : '';
|
|
145
145
|
}
|
|
146
146
|
|
package/package.json
CHANGED
package/src/N3DataFactory.js
CHANGED
|
@@ -125,10 +125,10 @@ export class Literal extends Term {
|
|
|
125
125
|
|
|
126
126
|
// ### The direction of this literal
|
|
127
127
|
get direction() {
|
|
128
|
-
// Find the last double dash after the closing quote (e.g., '"abc"@en-us--ltr')
|
|
128
|
+
// Find the last double dash after the closing quote and language tag (e.g., '"abc"@en-us--ltr')
|
|
129
129
|
const id = this.id;
|
|
130
130
|
const endPos = id.lastIndexOf('"');
|
|
131
|
-
const dirPos = id.lastIndexOf('--');
|
|
131
|
+
const dirPos = id[endPos + 1] === '@' ? id.lastIndexOf('--') : -1;
|
|
132
132
|
return dirPos > endPos && dirPos + 2 < id.length ? id.substr(dirPos + 2).toLowerCase() : '';
|
|
133
133
|
}
|
|
134
134
|
|