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

Use here-strings for JSON in Compile.ps1 #2816

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ruxunderscore
Copy link
Contributor

@ruxunderscore ruxunderscore commented Sep 24, 2024

NOTE: I recommend going through my commits to see the changes I made over time, to better understand why I coded things the way I did.

Change Compile.ps1 to use here-strings with JSON.

Type of Change

  • Refactoring

Description

This modifies the Compile.ps1 script's handling of JSON to use here-strings and -Raw, similar to what we do with Xaml. This allows us to forego the replace when we ConvertTo-Json -Depth 3.

There are a couple formatting to CamelCasing changes for consistency, as well.

Testing

Tested the Compile in pwsh and powershell (pulled in changes from @og-mrk for Pre-processing for testing in PS5.)

Checklist

  • My code adheres to the coding and style guidelines of the project.
  • I have performed a self-review of my own code.
  • My changes generate no errors/warnings/merge conflicts.

- Change Compile.ps1 to use here-strings with JSON, similar to my changes to Xaml being ingested using here-strings.
- Modifications, allowing for the removal of all .replace() functions in JSON handler.
- Changed formatting of here-string on line 91 -> 89 to prevent accidental double in winutil.ps1 (Doesn't cause an issue, but looks better.)
- Added here-string to 95 -> 93 (This allowed the removal of the final .replace())
- Added comment to line 90.
@ruxunderscore ruxunderscore marked this pull request as ready for review September 24, 2024 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant