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 hasOwnProperty from Object.prototype #510

Merged
merged 1 commit into from Aug 23, 2022
Merged

Conversation

Uzlopak
Copy link
Contributor

@Uzlopak Uzlopak commented Aug 23, 2022

I did not benchmark

Checklist

Copy link
Member

@ivan-tymoshenko ivan-tymoshenko left a comment

Choose a reason for hiding this comment

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

LGTM, does it really make a difference?

@mcollina
Copy link
Member

it's not about perf, it's about protecting from prototype injection

@Uzlopak Uzlopak changed the title use hasOwnProperty from prototype use hasOwnProperty from Object.prototype Aug 23, 2022
@Uzlopak Uzlopak merged commit cd586bf into master Aug 23, 2022
@Uzlopak Uzlopak deleted the use-hasOwnProperty branch August 23, 2022 08:16
mcollina pushed a commit that referenced this pull request Aug 29, 2022
* Improved performance for const schema

* Improve const object schema performance

* Improve string and object performance

* Restored example file

* Changed findIndex with indexOf

* Removed useless inference when schema is const

* Review requests
- Removed switchTypeSchema
- Use of variable isRequired where defined
- Rebase to PR #510
- Remove use of default value for const

* Rebase to #510 (use hasOwnProperty from Object.prototype)

* Use isRequired when available

* Restored FJS format style

* Restore FJS format style

* Added support for nullable / type: [..., 'null']
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.

None yet

3 participants