datum icon indicating copy to clipboard operation
datum copied to clipboard

Merge-DatumArray doesn't always return an array

Open ykuijs opened this issue 2 years ago • 1 comments

During some testing I found that the Merge-DatumArray function doesn't always return an array, but an OrderedDictionary. This results in an error when the next level is merged and Datum throwing the error: Write-Warning -Message "Cannot merge different types in path '$StartingPath' REF:[hashtable] | DIFF:[hash_array] , returning most specific Datum."

I tracked down this issue to this line: https://github.com/gaelcolas/datum/blob/a028e8e805a24367083f351c584e14372e13fde3/source/Private/Merge-DatumArray.ps1#L170

By adding a , (comma) in front, the function will return an array:

    , $mergedArray

ykuijs avatar Sep 21 '21 07:09 ykuijs

@ykuijs, as mentioned I and @nyanhp have never observed this. Can you give us some data to reproduce this, please?

raandree avatar Sep 24 '21 17:09 raandree