-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle large integers and PSCustomObjects
This change fixes the way powershell-yaml deals with two particular types: really large numbers and PSCustomObjects. When an integer larger than what an int64 could handle was deserialized, powershell-yaml would convert it to scientific notation. This is default behavior in powershell when you try to cast a number larger than [int64]::MaxValue to an [int64]. This change attempts to cast all numbers to [BigInteger] and then try to fit that value into the smallest possible type. If that is not possible, we leave it as [BigInteger]. This change also adds a custom type converter that properly serializes a [BigInteger] back to yaml. Another type we've had issues with is the PSCustomObject type. This change adds a custom type converter for that as well and removes the hack we had to do to cast the PSCustomObject to a dictionary before we serialize it. A final change made here was in the way the assembly we ship is built. The code was separated into a proper project and is built using the dotnet sdk. Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
- Loading branch information
1 parent
55fed1c
commit 7d1df5f
Showing
26 changed files
with
7,383 additions
and
10,819 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
src/obj | ||
src/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.