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

Fix: freezing arrays returned by public methods #1736

Merged
merged 12 commits into from
May 7, 2024

Conversation

RobinTail
Copy link
Owner

@RobinTail RobinTail commented May 6, 2024

This is a fix that prevents changing arrays after they have been assigned upon building an Endpoint, however, it could be potentially breaking, therefore I'm addressing it to v19.

@RobinTail RobinTail added refactoring The better way to achieve the same result prevention labels May 6, 2024
@RobinTail RobinTail force-pushed the endpoint-readonly-getters branch from ca7afca to c4cdb6f Compare May 6, 2024 21:19
@RobinTail RobinTail changed the base branch from master to make-v19 May 6, 2024 21:19
Copy link

coveralls-official bot commented May 6, 2024

Coverage Status

coverage: 100.0%. remained the same
when pulling 7f22a63 on endpoint-readonly-getters
into ce3b2c1 on make-v19.

RobinTail added 6 commits May 6, 2024 23:20
This serves two purposes:

- Enforcing constraints on its actual usage in `walkRouting()`,
- Should ease adoption of the new `QUERY` method in the future, see:
  - expressjs/express#5615
  - nodejs/node#51562
@RobinTail RobinTail force-pushed the endpoint-readonly-getters branch from c4cdb6f to e19fd98 Compare May 6, 2024 21:20
@RobinTail RobinTail added this to the v19 milestone May 6, 2024
@RobinTail RobinTail added the breaking Backward incompatible changes label May 6, 2024
@RobinTail RobinTail mentioned this pull request May 6, 2024
@RobinTail RobinTail marked this pull request as ready for review May 7, 2024 08:59
@RobinTail RobinTail changed the title Fix: freezing arrays returned by Endpoint getters Fix: freezing arrays returning public methods May 7, 2024
@RobinTail RobinTail changed the title Fix: freezing arrays returning public methods Fix: freezing arrays returned by public methods May 7, 2024
Copy link
Owner Author

@RobinTail RobinTail left a comment

Choose a reason for hiding this comment

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

ok

@RobinTail RobinTail merged commit 2e0c2e1 into make-v19 May 7, 2024
11 checks passed
@RobinTail RobinTail deleted the endpoint-readonly-getters branch May 7, 2024 09:58
RobinTail added a commit that referenced this pull request May 13, 2024
![image](https://github.com/RobinTail/express-zod-api/assets/13189514/f090c11f-4d73-409a-8546-5c586adb0afc)

Pebbles LaDime (Dime) Doe was a black transgender woman.


https://edition.cnn.com/2024/02/25/us/dime-doe-trial-south-carolina-federal-hate-crime/index.html

https://www.nbcnews.com/feature/nbc-out/south-carolina-death-marks-14th-black-transgender-woman-killed-u-n1040971

https://www.justice.gov/opa/pr/south-carolina-man-found-guilty-hate-crime-killing-transgender-woman-because-her-gender

Transgender women suffer too frequently from transphobic violence and
cruelty, being the less protected social group. I'd like to raise an
awareness of this problem. Humans should be creators — not killers. But
most importantly, I want every transgender girl to have an opportunity
to create applications quickly and, in general, learn to write code
easily in order to receive job offers and leave dangerously transphobic
territories for more favorable and civilized ones, and live happily
there. Protect transgender women.

------------------------------

This version is focused on making `express-zod-api` a complete `zod`
plugin. In this regard `withMeta` is removed in favor of the recommended
approach on extending `zod` functionality, which opens up opportunities
for new features and simplifies the consumer experience. Another
improvement has been made for parsers: they are now applied selectively
depending on the type of expected request.

- #1693 
- #1705 
- #1707 
- Theoretically #1631 
  - In advance #1708 
- #1726 
- #1736 
- #1741 
  - #1745 
  - #1762 
  - #1756 
  - #1766 
- #1730 
  - #1747 
  - #1748 
- #1755 
- #1760 

- Not included, but comes later: #1750 

⚠️ don't squash it, to avoid conflicts with #1750
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Backward incompatible changes prevention refactoring The better way to achieve the same result
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant