We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 60f7c77 commit f27bb96Copy full SHA for f27bb96
src/ld-query.js
@@ -535,6 +535,15 @@
535
// create an path alias '#document' to represent the root of the current QueryNode json
536
var stepId = 0;
537
steps = [{ id: stepId++, path: "#document", directChild: false, tests: [] }];
538
+
539
+ if(separatedSteps[0] && separatedSteps[0].key) {
540
541
+ // our first step is a bare test but we can't do this on the document as it might be anywhere in the structure
542
+ // so we create an empty step to attach the test to in the loop below.
543
+ steps.unshift({ id: stepId++, directChild: false, tests: [] });
544
545
+ }
546
547
// process the extracted steps, to combine 'where' steps into keys on path steps.
548
separatedSteps.forEach(function (step) {
549
0 commit comments