-
Notifications
You must be signed in to change notification settings - Fork 6
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
Add TypeScript #9
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super duper important
@@ -0,0 +1,12 @@ | |||
{ | |||
"requires": true, | |||
"lockfileVersion": 1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"lockfileVersion": 1, | |
"loackerfileVersion": 1, |
ArithmeticServer.ts
Outdated
@@ -18,9 +18,9 @@ http.createServer(function (request, response) { | |||
ans = 'num must be used with fibonacci pathname!'; | |||
} | |||
else { | |||
n = parseInt(queryData.num); | |||
let n = parseInt(queryData.num); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please define a custom type for n
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -18,9 +18,9 @@ http.createServer(function (request, response) { | |||
ans = 'num must be used with fibonacci pathname!'; | |||
} | |||
else { | |||
n = parseInt(queryData.num); | |||
let n:number = parseInt(queryData.num); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please extract parseInt
to a function to better encapsulate how to parse ints.
TypeScript is an open-source programming language developed and maintained by Microsoft. It is a strict syntactical superset of JavaScript, and adds optional static typing to the language.
Typescript is very robust, and this will really improve the code quality in this repository.