diff --git a/pkg/yqlib/doc/operators/entries.md b/pkg/yqlib/doc/operators/entries.md index a466e439..f1607361 100644 --- a/pkg/yqlib/doc/operators/entries.md +++ b/pkg/yqlib/doc/operators/entries.md @@ -67,7 +67,8 @@ a: 1 b: 2 ``` -## from_entries with numeric key indexes +## from_entries with numeric key indices + from_entries always creates a map, even for numeric keys Given a sample.yml file of: diff --git a/pkg/yqlib/doc/operators/pick.md b/pkg/yqlib/doc/operators/pick.md index 45bccc8b..3b477699 100644 --- a/pkg/yqlib/doc/operators/pick.md +++ b/pkg/yqlib/doc/operators/pick.md @@ -27,7 +27,7 @@ myMap: ``` ## Pick indices from array -Note that the order of the indexes matches the pick order and non existent indexes are skipped. +Note that the order of the indices matches the pick order and non existent indices are skipped. Given a sample.yml file of: ```yaml diff --git a/pkg/yqlib/operator_entries_test.go b/pkg/yqlib/operator_entries_test.go index 9313323d..b867b94d 100644 --- a/pkg/yqlib/operator_entries_test.go +++ b/pkg/yqlib/operator_entries_test.go @@ -36,7 +36,7 @@ var entriesOperatorScenarios = []expressionScenario{ }, }, { - description: "from_entries with numeric key indexes", + description: "from_entries with numeric key indices", subdescription: "from_entries always creates a map, even for numeric keys", document: `[a,b]`, expression: `to_entries | from_entries`, diff --git a/pkg/yqlib/operator_pick_test.go b/pkg/yqlib/operator_pick_test.go index 52fe9e2d..25542385 100644 --- a/pkg/yqlib/operator_pick_test.go +++ b/pkg/yqlib/operator_pick_test.go @@ -34,7 +34,7 @@ var pickOperatorScenarios = []expressionScenario{ }, { description: "Pick indices from array", - subdescription: "Note that the order of the indexes matches the pick order and non existent indexes are skipped.", + subdescription: "Note that the order of the indices matches the pick order and non existent indices are skipped.", document: `[cat, leopard, lion]`, expression: `pick([2, 0, 734, -5])`, expected: []string{ diff --git a/pkg/yqlib/operator_traverse_path.go b/pkg/yqlib/operator_traverse_path.go index 074bc039..54e6baa7 100644 --- a/pkg/yqlib/operator_traverse_path.go +++ b/pkg/yqlib/operator_traverse_path.go @@ -89,7 +89,7 @@ func traverseArrayOperator(d *dataTreeNavigator, context Context, expressionNode return Context{}, err } - // rhs is a collect expression that will yield indexes to retrieve of the arrays + // rhs is a collect expression that will yield indices to retrieve of the arrays rhs, err := d.GetMatchingNodes(context.ReadOnlyClone(), expressionNode.RHS) @@ -267,7 +267,7 @@ func traverseMap(context Context, matchingNode *CandidateNode, keyNode *yaml.Nod func doTraverseMap(newMatches *orderedmap.OrderedMap, candidate *CandidateNode, wantedKey string, prefs traversePreferences, splat bool) error { // value.Content is a concatenated array of key, value, - // so keys are in the even indexes, values in odd. + // so keys are in the even indices, values in odd. // merge aliases are defined first, but we only want to traverse them // if we don't find a match directly on this node first.