Array to map operator for #1415

This commit is contained in:
Mike Farah
2022-11-08 13:40:00 +11:00
parent c915113120
commit bd5e5dc965
8 changed files with 113 additions and 0 deletions
+8
View File
@@ -147,6 +147,14 @@ var propertyScenarios = []formatScenario{
expected: expectedDecodedYaml,
scenarioType: "decode",
},
{
description: "Decode properties - array should be a map",
subdescription: "If you have a numeric map key in your property files, use array_to_map to convert them to maps.",
input: `things.10 = mike`,
expression: `.things |= array_to_map`,
expected: "things:\n 10: mike\n",
scenarioType: "decode",
},
{
description: "does not expand automatically",
skipDoc: true,