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

Cleaner code for LD and JSON parsing #625

Merged
merged 2 commits into from
Oct 3, 2024
Merged

Cleaner code for LD and JSON parsing #625

merged 2 commits into from
Oct 3, 2024

Conversation

MaxDall
Copy link
Collaborator

@MaxDall MaxDall commented Oct 3, 2024

This PR aims to make the code about LD and JSON parsing a bit less complex. Further, I removed some unused imports for TheNamibian

@MaxDall MaxDall requested a review from addie9800 October 3, 2024 12:43
Copy link
Collaborator

@addie9800 addie9800 left a comment

Choose a reason for hiding this comment

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

Nice modification. It makes a lot more sense to move that to utility

return None

# substitute "bad" values
sanitized = re.sub(_json_undefined, r"\g<key>:null", sanitized)
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is possible? 🤯 You don't want to know how often I worked around that to avoid selecting text I don't want to loose due to substitution...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I feel you 😄 regex is a rabbit hole and every time I have to use it I find myself half an hour and 30 open tabs later scratching my head.

@MaxDall MaxDall merged commit 4addcbd into master Oct 3, 2024
5 checks passed
@MaxDall MaxDall deleted the cleaner-code branch October 3, 2024 16:03
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.

2 participants