Skip to content

Commit 384bed6

Browse files
#4 Types in Typescript
1 parent 31d1d34 commit 384bed6

File tree

8 files changed

+164
-25
lines changed

8 files changed

+164
-25
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,4 @@ typings/
5656

5757
# dotenv environment variables file
5858
.env
59-
59+
dist

index.js

Lines changed: 0 additions & 8 deletions
This file was deleted.

index.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

index.ts

Lines changed: 0 additions & 11 deletions
This file was deleted.

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
"author": "Nicolás Serrano Arévalo <[email protected]>",
88
"license": "MIT",
99
"scripts": {
10-
"start": "node index.js",
11-
"prestart": "tsc"
10+
"start": "tsc-watch --onSuccess \" node dist/index.js\" "
11+
},
12+
"devDependencies": {
13+
"tsc-watch": "^1.0.17"
1214
}
1315
}

src/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
const sayHi = (name: string, age: number, gender: string): string => {
2+
return `Hello ${name}, you are ${age}, you are a ${gender}!`;
3+
};
4+
5+
console.log(sayHi("Nicolas", 24, "male"));
6+
7+
export {};

tsconfig.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
"compilerOptions": {
33
"module": "commonjs",
44
"target": "ES2015",
5-
"sourceMap": true
5+
"sourceMap": true,
6+
"outDir": "dist"
67
},
7-
"include": ["index.ts"],
8+
"include": ["src/**/*"],
89
"exclude": ["node_modules"]
910
}

yarn.lock

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2+
# yarn lockfile v1
3+
4+
5+
ansi-styles@^3.2.1:
6+
version "3.2.1"
7+
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d"
8+
dependencies:
9+
color-convert "^1.9.0"
10+
11+
chalk@^2.3.0:
12+
version "2.3.2"
13+
resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.3.2.tgz#250dc96b07491bfd601e648d66ddf5f60c7a5c65"
14+
dependencies:
15+
ansi-styles "^3.2.1"
16+
escape-string-regexp "^1.0.5"
17+
supports-color "^5.3.0"
18+
19+
color-convert@^1.9.0:
20+
version "1.9.1"
21+
resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.1.tgz#c1261107aeb2f294ebffec9ed9ecad529a6097ed"
22+
dependencies:
23+
color-name "^1.1.1"
24+
25+
color-name@^1.1.1:
26+
version "1.1.3"
27+
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25"
28+
29+
cross-spawn@^5.1.0:
30+
version "5.1.0"
31+
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449"
32+
dependencies:
33+
lru-cache "^4.0.1"
34+
shebang-command "^1.2.0"
35+
which "^1.2.9"
36+
37+
duplexer@~0.1.1:
38+
version "0.1.1"
39+
resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.1.tgz#ace6ff808c1ce66b57d1ebf97977acb02334cfc1"
40+
41+
escape-string-regexp@^1.0.5:
42+
version "1.0.5"
43+
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
44+
45+
event-stream@~3.3.0:
46+
version "3.3.4"
47+
resolved "http://registry.npmjs.org/event-stream/-/event-stream-3.3.4.tgz#4ab4c9a0f5a54db9338b4c34d86bfce8f4b35571"
48+
dependencies:
49+
duplexer "~0.1.1"
50+
from "~0"
51+
map-stream "~0.1.0"
52+
pause-stream "0.0.11"
53+
split "0.3"
54+
stream-combiner "~0.0.4"
55+
through "~2.3.1"
56+
57+
from@~0:
58+
version "0.1.7"
59+
resolved "https://registry.yarnpkg.com/from/-/from-0.1.7.tgz#83c60afc58b9c56997007ed1a768b3ab303a44fe"
60+
61+
has-flag@^3.0.0:
62+
version "3.0.0"
63+
resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd"
64+
65+
isexe@^2.0.0:
66+
version "2.0.0"
67+
resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10"
68+
69+
lru-cache@^4.0.1:
70+
version "4.1.2"
71+
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.2.tgz#45234b2e6e2f2b33da125624c4664929a0224c3f"
72+
dependencies:
73+
pseudomap "^1.0.2"
74+
yallist "^2.1.2"
75+
76+
map-stream@~0.1.0:
77+
version "0.1.0"
78+
resolved "https://registry.yarnpkg.com/map-stream/-/map-stream-0.1.0.tgz#e56aa94c4c8055a16404a0674b78f215f7c8e194"
79+
80+
81+
version "0.0.11"
82+
resolved "https://registry.yarnpkg.com/pause-stream/-/pause-stream-0.0.11.tgz#fe5a34b0cbce12b5aa6a2b403ee2e73b602f1445"
83+
dependencies:
84+
through "~2.3"
85+
86+
ps-tree@^1.1.0:
87+
version "1.1.0"
88+
resolved "https://registry.yarnpkg.com/ps-tree/-/ps-tree-1.1.0.tgz#b421b24140d6203f1ed3c76996b4427b08e8c014"
89+
dependencies:
90+
event-stream "~3.3.0"
91+
92+
pseudomap@^1.0.2:
93+
version "1.0.2"
94+
resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3"
95+
96+
shebang-command@^1.2.0:
97+
version "1.2.0"
98+
resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea"
99+
dependencies:
100+
shebang-regex "^1.0.0"
101+
102+
shebang-regex@^1.0.0:
103+
version "1.0.0"
104+
resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3"
105+
106+
107+
version "0.3.3"
108+
resolved "https://registry.yarnpkg.com/split/-/split-0.3.3.tgz#cd0eea5e63a211dfff7eb0f091c4133e2d0dd28f"
109+
dependencies:
110+
through "2"
111+
112+
stream-combiner@~0.0.4:
113+
version "0.0.4"
114+
resolved "https://registry.yarnpkg.com/stream-combiner/-/stream-combiner-0.0.4.tgz#4d5e433c185261dde623ca3f44c586bcf5c4ad14"
115+
dependencies:
116+
duplexer "~0.1.1"
117+
118+
supports-color@^5.3.0:
119+
version "5.3.0"
120+
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.3.0.tgz#5b24ac15db80fa927cf5227a4a33fd3c4c7676c0"
121+
dependencies:
122+
has-flag "^3.0.0"
123+
124+
through@2, through@~2.3, through@~2.3.1:
125+
version "2.3.8"
126+
resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5"
127+
128+
tsc-watch@^1.0.17:
129+
version "1.0.17"
130+
resolved "https://registry.yarnpkg.com/tsc-watch/-/tsc-watch-1.0.17.tgz#c33e564aba93617823b17996f2dd999cefb7a0b9"
131+
dependencies:
132+
chalk "^2.3.0"
133+
cross-spawn "^5.1.0"
134+
ps-tree "^1.1.0"
135+
typescript "*"
136+
137+
typescript@*:
138+
version "2.7.2"
139+
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.7.2.tgz#2d615a1ef4aee4f574425cdff7026edf81919836"
140+
141+
which@^1.2.9:
142+
version "1.3.0"
143+
resolved "https://registry.yarnpkg.com/which/-/which-1.3.0.tgz#ff04bdfc010ee547d780bec38e1ac1c2777d253a"
144+
dependencies:
145+
isexe "^2.0.0"
146+
147+
yallist@^2.1.2:
148+
version "2.1.2"
149+
resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52"

0 commit comments

Comments
 (0)