Updating docs

This commit is contained in:
Mike Farah 2021-06-10 08:35:41 +10:00
parent 78af68f436
commit 09c5ed24be
3 changed files with 9 additions and 9 deletions

View File

@ -1,4 +1,4 @@
This is the simplest (and perhaps most used) operator, it is used to navigate deeply into yaml structurse. This is the simplest (and perhaps most used) operator, it is used to navigate deeply into yaml structures.
## Simple map navigation ## Simple map navigation
Given a sample.yml file of: Given a sample.yml file of:
```yaml ```yaml
@ -63,7 +63,7 @@ will output
frog frog
``` ```
## Multiple special characters ## Nested special characters
Given a sample.yml file of: Given a sample.yml file of:
```yaml ```yaml
a: a:
@ -230,8 +230,7 @@ will output
## Traversing nested arrays by index ## Traversing nested arrays by index
Given a sample.yml file of: Given a sample.yml file of:
```yaml ```yaml
- [] [[], [cat]]
- - cat
``` ```
then then
```bash ```bash

View File

@ -1 +1 @@
This is the simplest (and perhaps most used) operator, it is used to navigate deeply into yaml structurse. This is the simplest (and perhaps most used) operator, it is used to navigate deeply into yaml structures.

View File

@ -78,7 +78,7 @@ var traversePathOperatorScenarios = []expressionScenario{
}, },
}, },
{ {
description: "Multiple special characters", description: "Nested special characters",
document: `a: {"key.withdots": {"another.key": apple}}`, document: `a: {"key.withdots": {"another.key": apple}}`,
expression: `.a["key.withdots"]["another.key"]`, expression: `.a["key.withdots"]["another.key"]`,
expected: []string{ expected: []string{
@ -253,9 +253,10 @@ var traversePathOperatorScenarios = []expressionScenario{
}, },
}, },
{ {
description: "Traversing nested arrays by index", description: "Traversing nested arrays by index",
document: `[[], [cat]]`, dontFormatInputForDoc: true,
expression: `.[1][0]`, document: `[[], [cat]]`,
expression: `.[1][0]`,
expected: []string{ expected: []string{
"D0, P[1 0], (!!str)::cat\n", "D0, P[1 0], (!!str)::cat\n",
}, },