Skip to content

Commit b71ff36

Browse files
committed
Fix paths for Lesson03
1 parent bd2fe88 commit b71ff36

File tree

12 files changed

+29
-25
lines changed

12 files changed

+29
-25
lines changed

Lesson03/Activity04/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Lesson03/Activity04/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "activity_001",
2+
"name": "Activity04",
33
"version": "1.0.0",
44
"description": "Application that will scrape the storefront to fetch data and write to a CSV file.",
55
"main": "index.js",
@@ -9,7 +9,7 @@
99
"repository": {
1010
"type": "git",
1111
"url": "git+https://github.com/TrainingByPackt/Professional-JavaScript.git",
12-
"directory": "Lesson03/activity_001"
12+
"directory": "Lesson03/Activity04"
1313
},
1414
"license": "MIT",
1515
"dependencies": {

Lesson03/Example/sample_scraping/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"repository": {
77
"type": "git",
88
"url": "git+https://github.com/TrainingByPackt/Professional-JavaScript.git",
9-
"directory": "Lesson03/sample_scraping"
9+
"directory": "Lesson03/Example/sample_scraping"
1010
},
1111
"author": "",
1212
"license": "MIT",

Lesson03/Exercise11/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
2-
"name": "exercise_001",
2+
"name": "Exercise11",
33
"version": "1.0.0",
44
"description": "First exercise for lesson 3.",
55
"main": "index.js",
66
"repository": {
77
"type": "git",
88
"url": "git+https://github.com/TrainingByPackt/Professional-JavaScript.git",
9-
"directory": "Lesson03/exercise_001"
9+
"directory": "Lesson03/Exercise11"
1010
},
1111
"license": "MIT"
1212
}

Lesson03/Exercise12/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"name": "exercise_002",
33
"version": "1.0.0",
4-
"description": "Second exercise for lesson 3",
4+
"description": "Application to search for files using globs",
55
"main": "index.js",
66
"repository": {
77
"type": "git",
88
"url": "git+https://github.com/TrainingByPackt/Professional-JavaScript.git",
9-
"directory": "Lesson03/exercise_002"
9+
"directory": "Lesson03/Exercise12"
1010
},
1111
"license": "MIT",
1212
"dependencies": {

Lesson03/Exercise13/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Lesson03/Exercise13/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
{
2-
"name": "exercise_003",
2+
"name": "Exercise13",
33
"version": "1.0.0",
44
"description": "Static HTTP server.",
55
"main": "index.js",
66
"repository": {
77
"type": "git",
88
"url": "git+https://github.com/TrainingByPackt/Professional-JavaScript.git",
9-
"directory": "Lesson03/exercise_003"
9+
"directory": "Lesson03/Exercise13"
1010
},
11-
"author": "",
1211
"license": "MIT",
1312
"dependencies": {
1413
"mime": "^2.4.4"

Lesson03/Exercise14/package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Lesson03/Exercise14/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
{
2-
"name": "exercise_004",
2+
"name": "Exercise14",
33
"version": "1.0.0",
44
"description": "Exercise that demonstrate how to create a dynamic web server",
55
"main": "index.js",
66
"repository": {
77
"type": "git",
8-
"url": "git+https://github.com/TrainingByPackt/Professional-JavaScript.git"
8+
"url": "git+https://github.com/TrainingByPackt/Professional-JavaScript.git",
9+
"directory": "Lesson03/Exercise14"
910
},
1011
"license": "MIT",
1112
"dependencies": {
12-
"handlebars": "^4.1.2",
13+
"handlebars": "^4.4.2",
1314
"mime": "^2.4.4"
1415
}
1516
}

Lesson03/Exercise15/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@ function findArticles(document) {
3333
const split = parsedUrl.pathname.split('/').filter((s) => s.trim() != '');
3434
return split.length == 2;
3535
}).forEach(el => {
36-
const description = el.parentNode.nextSibling.querySelector('p a').text;
36+
let description = '[Description unnavailable]';
37+
if (el.parentNode && el.parentNode.nextSibling && el.parentNode.nextSibling.querySelector('p a, h3 a')) {
38+
description = el.parentNode.nextSibling.querySelector('p a, h3 a').text;
39+
}
40+
3741
articles[el.text] = {
3842
description: description,
3943
link: url.parse(el.href).pathname,

Lesson03/Exercise15/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Lesson03/Exercise15/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
2-
"name": "exercise_005",
2+
"name": "Exercise15",
33
"version": "1.0.0",
44
"description": "Application to fetch Medium topic pages and print article information to console.",
55
"main": "index.js",
66
"repository": {
77
"type": "git",
88
"url": "git+https://github.com/TrainingByPackt/Professional-JavaScript.git",
9-
"directory": "Lesson003/exercise_005"
9+
"directory": "Lesson03/Exercise15"
1010
},
1111
"author": "",
1212
"license": "MIT",

0 commit comments

Comments
 (0)