Skip to content

Commit fb27ba6

Browse files
adding typescript
1 parent 78fd7c8 commit fb27ba6

File tree

6 files changed

+111
-1
lines changed

6 files changed

+111
-1
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
.vscode
1+
.vscode
2+
node_modules

index.js

Whitespace-only changes.

package-lock.json

+28
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "codewars",
3+
"version": "1.0.0",
4+
"description": "This is a repository of code challenges that I have compiled. I often do at least a coding challenge every day to keep my mind fresh!",
5+
"main": "index.js",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1"
8+
},
9+
"author": "",
10+
"license": "ISC",
11+
"dependencies": {
12+
"typescript": "^5.2.2"
13+
}
14+
}

test-files/test.html

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>Document</title>
7+
</head>
8+
<body>
9+
<script src="testing.js"></script>
10+
</body>
11+
</html>

test-files/testing.js

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
const boardInfo = {
2+
users: ['64c9bab60612eb65806eef8e'],
3+
boardName: 'cjin10 postman test 4',
4+
columns: [
5+
{
6+
title: 'Backlog',
7+
tasks: [
8+
{
9+
taskName: 'Add your tasks here!',
10+
assignedUserIds: [],
11+
priority: 1,
12+
tags: [],
13+
taskDetail: 'Add more in-depth task information here!',
14+
_id: '64de7727197b715a3b158e56',
15+
created_at: '2023-08-17T19:38:15.022Z',
16+
comments: [],
17+
},
18+
],
19+
_id: '64de7727197b715a3b158e55',
20+
},
21+
{
22+
title: 'Todo',
23+
tasks: [],
24+
_id: '64de7727197b715a3b158e57',
25+
},
26+
{
27+
title: 'In Progress',
28+
tasks: [],
29+
_id: '64de7727197b715a3b158e58',
30+
},
31+
{
32+
title: 'Done',
33+
tasks: [],
34+
_id: '64de7727197b715a3b158e59',
35+
},
36+
],
37+
createdBy: '64c9bab60612eb65806eef8e',
38+
description: 'postman test 8-17',
39+
_id: '64de7727197b715a3b158e54',
40+
createdAt: '2023-08-17T19:38:15.023Z',
41+
__v: 0,
42+
}
43+
44+
let tasks = null
45+
const getColumns = board => {
46+
return board.columns
47+
}
48+
49+
// columns is an array
50+
const getTasks = columns => {
51+
return columns.map(column => column.tasks)
52+
}
53+
54+
// console.log(boardInfo)
55+
// console.log(getColumns(boardInfo))
56+
console.log(getTasks(boardInfo.columns))

0 commit comments

Comments
 (0)