Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Byte Conversion Functions; Remove Duplicate Task Process Definitions #1424

Merged
merged 1 commit into from
Oct 18, 2024

Conversation

mdaneri
Copy link
Contributor

@mdaneri mdaneri commented Oct 18, 2024

Summary of Changes:

  1. Removed ConvertFrom-PodeValueToByteArray:

    • The function ConvertFrom-PodeValueToByteArray has been removed as it's no longer needed.
  2. Updated Encoding Logic in Response.ps1:

    • In Public/Response.ps1, line 219, the following change was made:
      Replaced:
$Bytes = ConvertFrom-PodeValueToByteArray -Value $Value 

With:

$Bytes = [System.Text.Encoding]::UTF8.GetBytes($Value) 
  1. Removed Duplicated Get-PodeTaskProcess:

    • The function Get-PodeTaskProcess had a duplicate definition, which has been removed.
  2. Renamed ConvertFrom-PodeValueToByteArray to ConvertFrom-PodeStreamToByteArray:

    • The remaining instances of ConvertFrom-PodeValueToByteArray were renamed to ConvertFrom-PodeStreamToByteArray to reflect its actual functionality and improve clarity.

 ### Summary of Changes:

1. **Removed `ConvertFrom-PodeValueToByteArray`**:
    - The function `ConvertFrom-PodeValueToByteArray` has been removed as it's no longer needed.

2. **Updated Encoding Logic in `Response.ps1`**:
    - In `Public/Response.ps1`, line 219, the following change was made:
      - Replaced:
        ```powershell
        $Bytes = ConvertFrom-PodeValueToByteArray -Value $Value
        ```
      - With:
        ```powershell
        $Bytes = [System.Text.Encoding]::UTF8.GetBytes($Value)
        ```

3. **Removed Duplicated `Get-PodeTaskProcess`**:
    - The function `Get-PodeTaskProcess` had a duplicate definition, which has been removed.

4. **Renamed `ConvertFrom-PodeValueToByteArray` to `ConvertFrom-PodeStreamToByteArray`**:
    - The remaining instances of `ConvertFrom-PodeValueToByteArray` were renamed to `ConvertFrom-PodeStreamToByteArray` to reflect its actual functionality and improve clarity.
Copy link
Owner

@Badgerati Badgerati left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Badgerati Badgerati added this to the 2.11.1 milestone Oct 18, 2024
@Badgerati Badgerati changed the title Refactor Byte Conversion Functions and Remove Duplicate Task Process Definitions Refactor Byte Conversion Functions; Remove Duplicate Task Process Definitions Oct 18, 2024
@Badgerati Badgerati merged commit a181172 into Badgerati:develop Oct 18, 2024
14 checks passed
@mdaneri mdaneri deleted the remove-duplicated-functions branch October 18, 2024 18:18
@Badgerati Badgerati mentioned this pull request Nov 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants