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 typestack validateBody hook #786

Merged
merged 1 commit into from Aug 7, 2020

Conversation

AleksandrSl
Copy link
Contributor

@AleksandrSl AleksandrSl commented Aug 6, 2020

Fixes #785

Checklist

  • Add/update/check docs (code comments and docs/ folder).
  • Add/update/check tests.
  • Update/check the cli generators.

I'm not sure what the target branch should be

@LoicPoullain LoicPoullain self-requested a review August 7, 2020 08:40
@LoicPoullain LoicPoullain added this to Work In Progress in Issue tracking via automation Aug 7, 2020
@LoicPoullain LoicPoullain changed the base branch from master to v1-10-1 August 7, 2020 08:40
@LoicPoullain LoicPoullain changed the base branch from v1-10-1 to master August 7, 2020 08:42
@LoicPoullain LoicPoullain changed the base branch from master to v1-10-1 August 7, 2020 08:42
Copy link
Member

@LoicPoullain LoicPoullain left a comment

Choose a reason for hiding this comment

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

Good catch! Thanks 👍

@@ -38,5 +39,5 @@ export function ValidateBody(
}

function isArrowFunction(value: any): value is ((controller: any) => Class) {
return !value.hasOwnProperty('prototype');
return !Object.prototype.hasOwnProperty.call(value, 'prototype');
Copy link
Member

Choose a reason for hiding this comment

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

Why this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just to be sure that we won't break, if someone gives us object with builtin properties messed up. Maybe it's overkill

@LoicPoullain LoicPoullain mentioned this pull request Aug 7, 2020
2 tasks
@LoicPoullain LoicPoullain merged commit a18e371 into FoalTS:v1-10-1 Aug 7, 2020
Issue tracking automation moved this from Work In Progress to Done / Closed This Release Aug 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Issue tracking
  
Done / Closed This Release
Development

Successfully merging this pull request may close these issues.

Error in typestack ValidateBody
2 participants