| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 49a6ea1 commit 1f00359
11 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -71,7 +71,7 @@ const obj3 = { | |||
| 71 | 71 | a : { | |
| 72 | 72 | b : 1 | |
| 73 | 73 | } | |
| 74 | - } | ||
| 74 | + }; | ||
| 75 | 75 | const obj4 = Object.create(obj1); | |
| 76 | 76 | ||
| 77 | 77 | assert.deepEqual(obj1, obj1); | |
@@ -230,7 +230,7 @@ const assert = require('assert'); | |||
| 230 | 230 | ||
| 231 | 231 | assert.ifError(0); // OK | |
| 232 | 232 | assert.ifError(1); // Throws 1 | |
| 233 | - assert.ifError('error') // Throws 'error' | ||
| 233 | + assert.ifError('error'); // Throws 'error' | ||
| 234 | 234 | assert.ifError(new Error()); // Throws Error | |
| 235 | 235 | ``` | |
| 236 | 236 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -247,7 +247,7 @@ Buffers can be iterated over using the ECMAScript 2015 (ES6) `for..of` syntax: | |||
| 247 | 247 | const buf = Buffer.from([1, 2, 3]); | |
| 248 | 248 | ||
| 249 | 249 | for (var b of buf) | |
| 250 | - console.log(b) | ||
| 250 | + console.log(b); | ||
| 251 | 251 | ||
| 252 | 252 | // Prints: | |
| 253 | 253 | // 1 | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -236,7 +236,7 @@ var decrypted = ''; | |||
| 236 | 236 | decipher.on('readable', () => { | |
| 237 | 237 | var data = decipher.read(); | |
| 238 | 238 | if (data) | |
| 239 | - decrypted += data.toString('utf8'); | ||
| 239 | + decrypted += data.toString('utf8'); | ||
| 240 | 240 | }); | |
| 241 | 241 | decipher.on('end', () => { | |
| 242 | 242 | console.log(decrypted); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1022,12 +1022,12 @@ will be returned._ | |||
| 1022 | 1022 | // OS X and Linux | |
| 1023 | 1023 | fs.open('<directory>', 'a+', (err, fd) => { | |
| 1024 | 1024 | // => [Error: EISDIR: illegal operation on a directory, open <directory>] | |
| 1025 | - }) | ||
| 1025 | + }); | ||
| 1026 | 1026 | ||
| 1027 | 1027 | // Windows and FreeBSD | |
| 1028 | 1028 | fs.open('<directory>', 'a+', (err, fd) => { | |
| 1029 | 1029 | // => null, <fd> | |
| 1030 | - }) | ||
| 1030 | + }); | ||
| 1031 | 1031 | ``` | |
| 1032 | 1032 | ||
| 1033 | 1033 | ## fs.openSync(path, flags[, mode]) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -90,7 +90,7 @@ http.get({ | |||
| 90 | 90 | agent: false // create a new agent just for this one request | |
| 91 | 91 | }, (res) => { | |
| 92 | 92 | // Do stuff with response | |
| 93 | - }) | ||
| 93 | + }); | ||
| 94 | 94 | ``` | |
| 95 | 95 | ||
| 96 | 96 | ### new Agent([options]) | |
@@ -1451,8 +1451,8 @@ var req = http.request(options, (res) => { | |||
| 1451 | 1451 | console.log(`BODY: ${chunk}`); | |
| 1452 | 1452 | }); | |
| 1453 | 1453 | res.on('end', () => { | |
| 1454 | - console.log('No more data in response.') | ||
| 1455 | - }) | ||
| 1454 | + console.log('No more data in response.'); | ||
| 1455 | + }); | ||
| 1456 | 1456 | }); | |
| 1457 | 1457 | ||
| 1458 | 1458 | req.on('error', (e) => { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -231,7 +231,7 @@ options.agent = new https.Agent(options); | |||
| 231 | 231 | ||
| 232 | 232 | var req = https.request(options, (res) => { | |
| 233 | 233 | ... | |
| 234 | - } | ||
| 234 | + }); | ||
| 235 | 235 | ``` | |
| 236 | 236 | ||
| 237 | 237 | Alternatively, opt out of connection pooling by not using an `Agent`. | |
@@ -251,7 +251,7 @@ var options = { | |||
| 251 | 251 | ||
| 252 | 252 | var req = https.request(options, (res) => { | |
| 253 | 253 | ... | |
| 254 | - } | ||
| 254 | + }); | ||
| 255 | 255 | ``` | |
| 256 | 256 | ||
| 257 | 257 | [`Agent`]: #https_class_https_agent | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -234,7 +234,7 @@ path.format({ | |||
| 234 | 234 | base : "file.txt", | |
| 235 | 235 | ext : ".txt", | |
| 236 | 236 | name : "file" | |
| 237 | - }) | ||
| 237 | + }); | ||
| 238 | 238 | // returns 'C:\\path\\dir\\file.txt' | |
| 239 | 239 | ``` | |
| 240 | 240 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -398,10 +398,10 @@ For instance: `[[substr1, substr2, ...], originalsubstring]`. | |||
| 398 | 398 | ||
| 399 | 399 | ```js | |
| 400 | 400 | function completer(line) { | |
| 401 | - var completions = '.help .error .exit .quit .q'.split(' ') | ||
| 402 | - var hits = completions.filter((c) => { return c.indexOf(line) == 0 }) | ||
| 401 | + var completions = '.help .error .exit .quit .q'.split(' '); | ||
| 402 | + var hits = completions.filter((c) => { return c.indexOf(line) == 0 }); | ||
| 403 | 403 | // show all completions if none found | |
| 404 | - return [hits.length ? hits : completions, line] | ||
| 404 | + return [hits.length ? hits : completions, line]; | ||
| 405 | 405 | } | |
| 406 | 406 | ``` | |
| 407 | 407 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -492,7 +492,7 @@ net.createServer((socket) => { | |||
| 492 | 492 | output: socket | |
| 493 | 493 | }).on('exit', () => { | |
| 494 | 494 | socket.end(); | |
| 495 | - }) | ||
| 495 | + }); | ||
| 496 | 496 | }).listen('/tmp/node-repl-sock'); | |
| 497 | 497 | ||
| 498 | 498 | net.createServer((socket) => { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1227,9 +1227,9 @@ const Writable = require('stream').Writable; | |||
| 1227 | 1227 | const myWritable = new Writable({ | |
| 1228 | 1228 | write(chunk, encoding, callback) { | |
| 1229 | 1229 | if (chunk.toString().indexOf('a') >= 0) { | |
| 1230 | - callback(new Error('chunk is invalid')) | ||
| 1230 | + callback(new Error('chunk is invalid')); | ||
| 1231 | 1231 | } else { | |
| 1232 | - callback() | ||
| 1232 | + callback(); | ||
| 1233 | 1233 | } | |
| 1234 | 1234 | } | |
| 1235 | 1235 | }); | |
@@ -1252,9 +1252,9 @@ class MyWritable extends Writable { | |||
| 1252 | 1252 | ||
| 1253 | 1253 | _write(chunk, encoding, callback) { | |
| 1254 | 1254 | if (chunk.toString().indexOf('a') >= 0) { | |
| 1255 | - callback(new Error('chunk is invalid')) | ||
| 1255 | + callback(new Error('chunk is invalid')); | ||
| 1256 | 1256 | } else { | |
| 1257 | - callback() | ||
| 1257 | + callback(); | ||
| 1258 | 1258 | } | |
| 1259 | 1259 | } | |
| 1260 | 1260 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments