Skip to content

Commit 9feed98

Browse files
committed
Fixed for conflicts
2 parents b03dcfd + f5be3a8 commit 9feed98

File tree

9 files changed

+37
-89
lines changed

9 files changed

+37
-89
lines changed

.jshintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// JSHint Default Configuration File (as on JSHint website)
33
// See http://jshint.com/docs/ for more details
44

5-
"maxerr": 50, // {int} Maximum error before stopping
5+
"maxerr": false, // {int} Maximum error before stopping
66

77
// Enforcing
88
"bitwise": true, // true: Prohibit bitwise operators (&, |, ^, etc.)

HelloWorld/HelloWorld.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
/* jshint globalstrict: true */
22
/* jshint node: true */
3-
'use strict';
3+
"use strict";
44
function serve (req, res) {
55
res.writeHead(200, {
6-
'Content-Type"+': 'text/plain'
6+
"Content-Type"+": "text/plain"
77
});
8-
res.end('Hello World\n');
8+
res.end("Hello World\n");
99
}
1010

11-
const http = require('http');
11+
const http = require("http");
1212

1313
const server = http.createServer(serve);
1414

15-
server.listen(1337, '127.0.0.1');
15+
server.listen(1337, "127.0.0.1");
1616

17-
console.log('Server running at http://127.0.0.1:1337/');
17+
console.log("Server running at http://127.0.0.1:1337/");

asmodule/proto.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function parseArgs(noOfArgs) {
2727
}
2828

2929
if (argc > 2) {
30-
parseArgs(argc);
30+
parseArgs(argc);
3131

3232
const fs = require("fs");
3333
const finder = require("./find.js");
@@ -42,7 +42,7 @@ fs.readdir(".", function(err, files) {
4242
findPatternObject.find()
4343
.on("found",
4444
function(file, match) {
45-
console.log("Matched '" + match + "' in file " + file);
45+
console.log("Matched <" + match + "> in file " + file);
4646
})
4747
.on("fileread", function(file) { console.log("Read file " + file); })
4848
.on("error",

asyncflow/asyncflow.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*jshint globalstrict: true*/
22
/*jshint node: true */
33
/*jshint esversion: 6 */
4-
'use strict';
4+
"use strict";
55

66
function asyncFlow(generatorFunction) {
77
let generator;
@@ -16,13 +16,13 @@ function asyncFlow(generatorFunction) {
1616
generator.next();
1717
}
1818

19-
const fs = require('fs'),
20-
path = require('path');
19+
const fs = require("fs"),
20+
path = require("path");
2121

2222

2323
asyncFlow(function*(callback) {
2424
const fileName = path.basename(__filename);
25-
const myself = yield fs.readFile(fileName, 'utf8', callback);
26-
yield fs.writeFile('clone_of_' + fileName, myself, callback);
27-
console.log('Clone created');
25+
const myself = yield fs.readFile(fileName, "utf8", callback);
26+
yield fs.writeFile("clone_of_" + fileName, myself, callback);
27+
console.log("Clone created");
2828
});

emitter/emitter.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ if (argc > 2) {
6565
})
6666
.on("found",
6767
function(file, match) {
68-
console.log("Matched '" + match + "' in file " + file);
68+
console.log("Matched <" + match + "> in file " + file);
69+
6970
})
7071
.on("error",
7172
function(

emitterproto/proto.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ if (argc > 2) {
7070
});
7171
finder.on("found",
7272
function(file, match) {
73-
console.log("Matched '" + match + "' in file " + file);
73+
console.log("Matched <" + match + "> in file " + file);
7474
});
7575
finder.on("error",function(err) {
7676
console.log("Error emitted: " + err.message);});
@@ -88,4 +88,3 @@ finder.on("found",
8888
});
8989
} else
9090
exitMessage();
91-

goalsserver/goalsserver.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,31 +12,31 @@ function log (err, newGoal) {
1212
}
1313

1414
function firstRoute(req, res) {
15-
res.send('Our first route is working. :)');
15+
res.send("Our first route is working. :)");
1616
}
1717

1818
// DEPENDENCIES AND SETUP
1919
// ===============================================
2020

21-
const express = require('express'),
21+
const express = require("express"),
2222
app = express(),
2323
port = Number(process.env.PORT || 8080);
2424

2525
// DATABASE
2626
// ===============================================
2727

2828
// Setup the database.
29-
const Datastore = require('nedb');
29+
const Datastore = require("nedb");
3030
const db = new Datastore({
31-
filename: 'goals.db', // provide a path to the database file
31+
filename: "goals.db", // provide a path to the database file
3232
autoload: true, // automatically load the database
3333
timestampData: true // automatically add and manage the fields createdAt and updatedAt
3434
});
3535

3636
// Let us check that we can save to the database.
3737
// Define a goal.
3838
const goal = {
39-
description: 'Do 10 minutes meditation every day',
39+
description: "Do 10 minutes meditation every day",
4040
};
4141

4242
// Save this goal to the database.
@@ -46,11 +46,11 @@ db.insert(goal, log);
4646
// ===============================================
4747

4848
// Define the home page route.
49-
app.get('/', firstRoute);
49+
app.get("/", firstRoute);
5050

5151
// START THE SERVER
5252
// ===============================================
5353

5454
app.listen(port, function() {
55-
console.log('Listening on port ' + port);
55+
console.log("Listening on port " + port);
5656
});

rndstreamer/rndstreamer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ function get_strings() {
5454
const {
5555
statusCode
5656
} = response;
57-
// const contentType = response.headers['content-type'];
57+
// const contentType = response.headers["content-type"];
5858

5959
let error;
6060
if (statusCode !== 200) {

spider5/validator.js

Lines changed: 11 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -6,68 +6,6 @@ const validator = require("validator");
66
const cmdConfig = require("./cmdconfig");
77
const assert = require("assert");
88

9-
<<<<<<< HEAD
10-
module.exports.validate = function()
11-
{
12-
const options = cmdConfig.options;
13-
let assertCount = 0;
14-
function inc()
15-
{
16-
assertCount++;
17-
return assertCount;
18-
}
19-
try{
20-
assert(options._all.url,"No url specified");
21-
}
22-
catch(err)
23-
{
24-
inc();
25-
console.error(err.message);
26-
}
27-
if (options._all.url)
28-
{
29-
try{
30-
assert(validator.isURL(options._all.url,{protocols:["http","https"],require_host: true, require_valid_protocol:true,require_protocols:true}),options._all.url + " is invalid.");
31-
}
32-
catch(err)
33-
{
34-
inc();
35-
console.error(err.message);
36-
}
37-
}
38-
if (options._all.concurrency !== undefined)
39-
try
40-
{
41-
assert(validator.isInt(options._all.concurrency.toString(),{min:1}),"Concurrency must be greater than 0");
42-
}
43-
catch(err)
44-
{
45-
inc();
46-
console.error(err.message);
47-
}
48-
49-
if (options._all.nesting !== undefined)
50-
{
51-
try {
52-
assert(validator.isInt(options._all.nesting.toString(),{gt:0}),"Nesting must be greater than 0");
53-
}
54-
catch(err)
55-
{
56-
inc();
57-
console.error(err.message);
58-
}
59-
}
60-
=======
61-
module.exports.validate = function() {
62-
const options = cmdConfig.options;
63-
let errors = [];
64-
errors = validateEmptyURL(options._all.url, errors);
65-
errors = validateURLFormat(options._all.url, errors);
66-
errors = validateConcurrency(options._all.concurrency, errors);
67-
errors = validateNesting(options._all.nesting, errors);
68-
return errors;
69-
};
70-
719
function validateEmptyURL(url, errors) {
7210
try {
7311
assert(url, "No url specified");
@@ -76,7 +14,6 @@ function validateEmptyURL(url, errors) {
7614
}
7715
return errors;
7816
}
79-
>>>>>>> development
8017

8118
function validateURLFormat(url, errors) {
8219
if (url) {
@@ -119,3 +56,14 @@ function validateNesting(nesting, errors) {
11956
}
12057
return errors;
12158
}
59+
60+
module.exports.validate = function() {
61+
const options = cmdConfig.options;
62+
let errors = [];
63+
errors = validateEmptyURL(options._all.url, errors);
64+
errors = validateURLFormat(options._all.url, errors);
65+
errors = validateConcurrency(options._all.concurrency, errors);
66+
errors = validateNesting(options._all.nesting, errors);
67+
return errors;
68+
};
69+

0 commit comments

Comments
 (0)