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

Improve Seq and remove newline from non-min empty in Immutable plugin #4241

Merged
merged 5 commits into from
Aug 14, 2017

Conversation

pedrottimark
Copy link
Contributor

Summary

  • enclose entries of keyed Seq in braces
  • enclose values of non-keyed Seq in brackets (not distinguishing indexed/non-indexed)
  • represent lazy Seq by ellipsis

This was a brain-buster to write and rewrite. Again, many thanks to y’all who have reviewed.

  • added printImmutableSeq to detect private properties and call public iterator methods unless collection is lazy
  • deleted length/size exception (that is, newline within brackets/braces in non-minified empty collection) because although I sympathize with it, now that the plugin calls same helper functions as pretty-format core:
    • the code becomes too complicated to understand and maintain
    • although notation is diff-friendly for empty versus non-empty, the inconsistency can be diff-unfriendly if you convert from an empty ECMAScript to corresponding Immutable collection
  • sorted SENTINEL constants
  • added printAsLeaf helper function

Test plan

@cpojer cpojer merged commit c61165e into jestjs:master Aug 14, 2017
@pedrottimark pedrottimark deleted the immutable-seq branch August 14, 2017 14:46
tushardhole pushed a commit to tushardhole/jest that referenced this pull request Aug 21, 2017
…jestjs#4241)

* Improve Seq and remove newline from non-min empty in Immutable plugin

* Edit comment

* Add tests for arguments and iterator

* Add assertions size toBeUndefined for lazy Seq
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants