Skip to content

Commit

Permalink
Fix #133 - Middleware hook names when converting to/from hash
Browse files Browse the repository at this point in the history
  • Loading branch information
devblackops committed Jan 12, 2019
1 parent 253c92a commit f984d3a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions PoshBot/Classes/MiddlewareConfiguration.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class MiddlewareConfiguration {
$hash = @{}
foreach ($type in [enum]::GetNames([MiddlewareType])) {
$hash.Add(
"$($type)Hooks",
$type,
$this."$($type)Hooks".GetEnumerator().foreach({$_.Value.ToHash()})
)
}
Expand All @@ -34,7 +34,7 @@ class MiddlewareConfiguration {
static [MiddlewareConfiguration] Serialize([hashtable]$DeserializedObject) {
$mc = [MiddlewareConfiguration]::new()
foreach ($type in [enum]::GetNames([MiddlewareType])) {
$DeserializedObject."$($type)Hooks".GetEnumerator().foreach({
$DeserializedObject.$type.GetEnumerator().foreach({
$hook = [MiddlewareHook]::new($_.Name, $_.Path)
$mc."$($type)Hooks".Add($hook.Name, $hook) > $null
})
Expand Down

0 comments on commit f984d3a

Please sign in to comment.