Skip to content

Commit 8c581a8

Browse files
Revert "Fix losing case sensitive keys"
This reverts commit 7980c7c. Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
1 parent 7e2611b commit 8c581a8

2 files changed

Lines changed: 1 addition & 10 deletions

File tree

Tests/powershell-yaml.Tests.ps1

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -693,13 +693,4 @@ int64: 9223372036854775807
693693
} | Should -Not -Throw
694694
}
695695
}
696-
697-
Describe 'Case insensitive keys in mappings' {
698-
It 'should deserialize both keys' {
699-
$yaml = '{"a": 1, "A": 2}'
700-
$result = ConvertFrom-Yaml -Yaml $yaml
701-
$result.a | Should -Be 1
702-
$result.A | Should -Be 2
703-
}
704-
}
705696
}

powershell-yaml.psm1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ function Convert-YamlMappingToHashtable {
244244
[switch] $Ordered
245245
)
246246
PROCESS {
247-
if ($Ordered) { $ret = [System.Collections.Specialized.OrderedDictionary]::new() } else { $ret = [hashtable]::new() }
247+
if ($Ordered) { $ret = [ordered]@{} } else { $ret = @{} }
248248
foreach($i in $Node.Children.Keys) {
249249
$ret[$i.Value] = Convert-YamlDocumentToPSObject $Node.Children[$i] -Ordered:$Ordered
250250
}

0 commit comments

Comments
 (0)