scorelab / Stackle

Stackle is an web communication portal aimed at providing Open Source organizations a platform to have discussions on their github projects and their issues. It provides Github intergration which allows adminstrator of an organization to create a forum thread for the particualr organization. Users signing in is able to view forums of the organizations they contribute to and engage in the forum discussions.
Apache License 2.0
104 stars 146 forks source link

Improving Validation #154

Closed kartikpandey2 closed 5 years ago

kartikpandey2 commented 5 years ago

Type of issue:

Short description on the issue

In file validator.js validation function is using bitwise operator for checking if keys exist in input body which is not good practice in JS code as it produces unreadable code read this. And also Object.keys(this.input) is repeated which affects performance of code as time complexity of Object.keys(this.input) operation is O(n).

Possible fix

We can cache the result of Object.keys(this.input).