-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I mean the linter rules, whitespace only.
- Loading branch information
Showing
11 changed files
with
152 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,28 @@ | ||
module.exports = { | ||
extends: "standard", | ||
env: { | ||
node: true, | ||
mocha: true, | ||
}, | ||
plugins: [ | ||
"standard" | ||
], | ||
parserOptions: { | ||
sourceType: "script" | ||
}, | ||
rules: { | ||
"brace-style": [2, "1tbs", {"allowSingleLine": true} ], | ||
"complexity": [2, 32], | ||
"curly": 2, | ||
"eqeqeq": 2, | ||
"no-use-before-define": 2, | ||
"no-caller": 2, | ||
"max-depth": 2, | ||
"complexity": [2, 32], | ||
"max-statements": [2, 41], | ||
"no-else-return": 2, // maybe | ||
"wrap-iife": [2, "inside"], | ||
"new-cap": 2, | ||
"strict": 2, | ||
"curly": 2, | ||
"quotes": [2, "single", "avoid-escape"], | ||
"brace-style": 2, | ||
"no-caller": 2, | ||
"no-cond-assign": 2, | ||
"no-else-return": 2, | ||
"no-unused-vars": [2, { "args": "after-used" }], | ||
"space-before-function-paren": 0, | ||
"semi": [2, "always", { | ||
"omitLastInOneLineBlock": true | ||
}] | ||
"no-use-before-define": 2, | ||
"quotes": [2, "single", "avoid-escape"], | ||
"semi": [2, "always", {"omitLastInOneLineBlock": true }], | ||
"space-before-function-paren": [2, "never"], | ||
"strict": 2, | ||
"wrap-iife": [2, "inside"] | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,24 +3,24 @@ | |
// Copyright 2011 Chris Williams <[email protected]> | ||
|
||
module.exports = { | ||
raw: function (emitter, buffer) { | ||
raw: function(emitter, buffer) { | ||
emitter.emit('data', buffer); | ||
}, | ||
|
||
// encoding: ascii utf8 utf16le ucs2 base64 binary hex | ||
// More: http://nodejs.org/api/buffer.html#buffer_buffer | ||
readline: function (delimiter, encoding) { | ||
readline: function(delimiter, encoding) { | ||
if (typeof delimiter === 'undefined' || delimiter === null) { delimiter = '\r' } | ||
if (typeof encoding === 'undefined' || encoding === null) { encoding = 'utf8' } | ||
// Delimiter buffer saved in closure | ||
var data = ''; | ||
return function (emitter, buffer) { | ||
return function(emitter, buffer) { | ||
// Collect data | ||
data += buffer.toString(encoding); | ||
// Split collected data by delimiter | ||
var parts = data.split(delimiter); | ||
data = parts.pop(); | ||
parts.forEach(function (part) { | ||
parts.forEach(function(part) { | ||
emitter.emit('data', part); | ||
}); | ||
}; | ||
|
@@ -41,13 +41,13 @@ module.exports = { | |
|
||
// Emit a data event each time a byte sequence (delimiter is an array of byte) is found | ||
// Sample usage : byteDelimiter([10, 13]) | ||
byteDelimiter: function (delimiter) { | ||
byteDelimiter: function(delimiter) { | ||
if (Object.prototype.toString.call(delimiter) !== '[object Array]') { | ||
delimiter = [ delimiter ]; | ||
} | ||
var buf = []; | ||
var nextDelimIndex = 0; | ||
return function (emitter, buffer) { | ||
return function(emitter, buffer) { | ||
for (var i = 0; i < buffer.length; i++) { | ||
buf[buf.length] = buffer[i]; | ||
if (buf[buf.length - 1] === delimiter[nextDelimIndex]) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.