@traqula/rules-sparql-1-1-adjust 0.0.20 → 0.0.21
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/index.cjs +16 -8
- package/package.json +4 -4
package/lib/index.cjs
CHANGED
|
@@ -9767,7 +9767,7 @@ var LexerBuilder = class _LexerBuilder {
|
|
|
9767
9767
|
};
|
|
9768
9768
|
|
|
9769
9769
|
// ../core/lib/TransformerObject.js
|
|
9770
|
-
var TransformerObject = class {
|
|
9770
|
+
var TransformerObject = class _TransformerObject {
|
|
9771
9771
|
defaultContext;
|
|
9772
9772
|
maxStackSize = 1e6;
|
|
9773
9773
|
/**
|
|
@@ -9777,12 +9777,15 @@ var TransformerObject = class {
|
|
|
9777
9777
|
constructor(defaultContext = {}) {
|
|
9778
9778
|
this.defaultContext = defaultContext;
|
|
9779
9779
|
}
|
|
9780
|
+
clone(newDefaultContext = {}) {
|
|
9781
|
+
return new _TransformerObject({ ...this.defaultContext, ...newDefaultContext });
|
|
9782
|
+
}
|
|
9780
9783
|
/**
|
|
9781
9784
|
* Function to shallow clone any type.
|
|
9782
9785
|
* @param obj
|
|
9783
9786
|
* @protected
|
|
9784
9787
|
*/
|
|
9785
|
-
|
|
9788
|
+
cloneObj(obj) {
|
|
9786
9789
|
if (obj === null || typeof obj !== "object") {
|
|
9787
9790
|
return obj;
|
|
9788
9791
|
}
|
|
@@ -9857,7 +9860,7 @@ var TransformerObject = class {
|
|
|
9857
9860
|
const ignoreKeys = context.ignoreKeys ?? defaultIgnoreKeys;
|
|
9858
9861
|
const shallowKeys = context.shallowKeys ?? defaultShallowKeys;
|
|
9859
9862
|
didShortCut = context.shortcut ?? defaultDidShortCut;
|
|
9860
|
-
const copy3 = copyFlag ? this.
|
|
9863
|
+
const copy3 = copyFlag ? this.cloneObj(curObject) : curObject;
|
|
9861
9864
|
handleMapperOnLen.push(stack.length);
|
|
9862
9865
|
mapperCopyStack.push(copy3);
|
|
9863
9866
|
mapperOrigStack.push(curObject);
|
|
@@ -9871,7 +9874,7 @@ var TransformerObject = class {
|
|
|
9871
9874
|
const val = copy3[key];
|
|
9872
9875
|
const onlyShallow = shallowKeys && shallowKeys?.has(key);
|
|
9873
9876
|
if (onlyShallow) {
|
|
9874
|
-
copy3[key] = this.
|
|
9877
|
+
copy3[key] = this.cloneObj(val);
|
|
9875
9878
|
}
|
|
9876
9879
|
if (ignoreKeys && ignoreKeys.has(key)) {
|
|
9877
9880
|
continue;
|
|
@@ -9952,12 +9955,15 @@ var TransformerObject = class {
|
|
|
9952
9955
|
};
|
|
9953
9956
|
|
|
9954
9957
|
// ../core/lib/TransformerTyped.js
|
|
9955
|
-
var TransformerTyped = class extends TransformerObject {
|
|
9958
|
+
var TransformerTyped = class _TransformerTyped extends TransformerObject {
|
|
9956
9959
|
defaultNodePreVisitor;
|
|
9957
9960
|
constructor(defaultContext = {}, defaultNodePreVisitor = {}) {
|
|
9958
9961
|
super(defaultContext);
|
|
9959
9962
|
this.defaultNodePreVisitor = defaultNodePreVisitor;
|
|
9960
9963
|
}
|
|
9964
|
+
clone(newDefaultContext = {}, newDefaultNodePreVisitor = {}) {
|
|
9965
|
+
return new _TransformerTyped({ ...this.defaultContext, ...newDefaultContext }, { ...this.defaultNodePreVisitor, ...newDefaultNodePreVisitor });
|
|
9966
|
+
}
|
|
9961
9967
|
/**
|
|
9962
9968
|
* Transform a single node.
|
|
9963
9969
|
* The transformation calls the preVisitor from starting from the startObject.
|
|
@@ -10046,10 +10052,13 @@ var TransformerTyped = class extends TransformerObject {
|
|
|
10046
10052
|
};
|
|
10047
10053
|
|
|
10048
10054
|
// ../core/lib/TransformerSubTyped.js
|
|
10049
|
-
var TransformerSubTyped = class extends TransformerTyped {
|
|
10055
|
+
var TransformerSubTyped = class _TransformerSubTyped extends TransformerTyped {
|
|
10050
10056
|
constructor(defaultContext = {}, defaultNodePreVisitor = {}) {
|
|
10051
10057
|
super(defaultContext, defaultNodePreVisitor);
|
|
10052
10058
|
}
|
|
10059
|
+
clone(newDefaultContext = {}, newDefaultNodePreVisitor = {}) {
|
|
10060
|
+
return new _TransformerSubTyped({ ...this.defaultContext, ...newDefaultContext }, { ...this.defaultNodePreVisitor, ...newDefaultNodePreVisitor });
|
|
10061
|
+
}
|
|
10053
10062
|
/**
|
|
10054
10063
|
* Shares the functionality and first two arguments with {@link this.transformNode}.
|
|
10055
10064
|
* The third argument allows you to also transform based on the subType of objects.
|
|
@@ -11451,8 +11460,7 @@ function findPatternBoundedVars(iter, boundedVars) {
|
|
|
11451
11460
|
optional: (op) => ({ next: op.patterns }),
|
|
11452
11461
|
service: (op) => ({ next: [op.name, ...op.patterns] }),
|
|
11453
11462
|
bind: (op) => ({ next: [op.variable] }),
|
|
11454
|
-
graph: (op) => ({ next: [op.name, ...op.patterns] })
|
|
11455
|
-
minus: (op) => ({ next: op.patterns.slice(0, 1) })
|
|
11463
|
+
graph: (op) => ({ next: [op.name, ...op.patterns] })
|
|
11456
11464
|
},
|
|
11457
11465
|
term: {
|
|
11458
11466
|
variable: (op) => {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@traqula/rules-sparql-1-1-adjust",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.21",
|
|
5
5
|
"description": "Traqula Lexer and Grammar Rules for sparql 1.1-ADJUST",
|
|
6
6
|
"lsd:module": true,
|
|
7
7
|
"license": "MIT",
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"build:transpile": " node \"../../node_modules/esbuild/bin/esbuild\" --format=cjs --bundle --log-level=error --outfile=lib/index.cjs lib/index.ts"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@traqula/core": "^0.0.
|
|
46
|
-
"@traqula/rules-sparql-1-1": "^0.0.
|
|
45
|
+
"@traqula/core": "^0.0.21",
|
|
46
|
+
"@traqula/rules-sparql-1-1": "^0.0.21"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "6e27b4bab942e473c11576196320bd52894ea5a4"
|
|
49
49
|
}
|