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

add pretty print to object mod #732

Merged
merged 6 commits into from
Jan 30, 2024

Conversation

briandowns
Copy link
Contributor

@briandowns briandowns commented Jan 24, 2024

Resolves: #682

What's Changed:

Added pretty print function into the Object module.

Type of Change:

  • Bug fix
  • New feature
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Housekeeping:

  • Tests have been updated to reflect the changes done within this PR (if applicable).
  • Documentation has been updated to reflect the changes done within this PR (if applicable).

Screenshots (If Applicable):

@briandowns briandowns self-assigned this Jan 24, 2024
Signed-off-by: Brian Downs <[email protected]>
@briandowns briandowns marked this pull request as ready for review January 24, 2024 23:53
Copy link
Member

@Jason2605 Jason2605 left a comment

Choose a reason for hiding this comment

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

Couple of comments!

docs/docs/standard-lib/object.md Outdated Show resolved Hide resolved
docs/docs/standard-lib/object.md Outdated Show resolved Hide resolved
docs/docs/standard-lib/object.md Outdated Show resolved Hide resolved
src/optionals/object/object.c Outdated Show resolved Hide resolved
src/optionals/object/object.c Outdated Show resolved Hide resolved
Signed-off-by: Brian Downs <[email protected]>
@Jason2605
Copy link
Member

A question for you, would you expect a method called prettyPrint to actually output to stdout rather than return a string? I think a method that returns the pretty output as a string would be useful but potentially under a different name, what do you think?

@briandowns
Copy link
Contributor Author

Yeah, that's a good point. I'll update this to print to stdout. What would you want the method name to be that would returned the "pretty" string?

@Jason2605
Copy link
Member

Actually we probably don't need the non-print version as you can just use JSON.stringify - at least for the minute until we extend it so we can pretty print more objects that aren't JSON serialisable

@briandowns
Copy link
Contributor Author

Good point.

@Jason2605
Copy link
Member

Thanks so much for this!

@Jason2605 Jason2605 merged commit af6a577 into dictu-lang:develop Jan 30, 2024
8 checks passed
@Jason2605 Jason2605 mentioned this pull request Sep 12, 2024
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.

[FEATURE] Pretty Print
2 participants