Skip to content

Commit 44a677a

Browse files
committed
Formatting change: {...} should have spaces inside the braces
1 parent f6c50ab commit 44a677a

8 files changed

+68
-68
lines changed

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,8 @@ then the `permessage-deflate` extension will receive the call:
234234

235235
```js
236236
ext.createServerSession([
237-
{server_no_context_takeover: true, server_max_window_bits: 8},
238-
{server_max_window_bits: 15}
237+
{ server_no_context_takeover: true, server_max_window_bits: 8 },
238+
{ server_max_window_bits: 15 }
239239
]);
240240
```
241241

@@ -251,8 +251,8 @@ implement the following methods, as well as the *Session* API listed below.
251251
```js
252252
clientSession.generateOffer()
253253
// e.g. -> [
254-
// {server_no_context_takeover: true, server_max_window_bits: 8},
255-
// {server_max_window_bits: 15}
254+
// { server_no_context_takeover: true, server_max_window_bits: 8 },
255+
// { server_max_window_bits: 15 }
256256
// ]
257257
```
258258

@@ -277,7 +277,7 @@ must implement the following methods, as well as the *Session* API listed below.
277277

278278
```js
279279
serverSession.generateResponse()
280-
// e.g. -> {server_max_window_bits: 8}
280+
// e.g. -> { server_max_window_bits: 8 }
281281
```
282282

283283
This returns the set of parameters the server session wants to send in its

lib/parser.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ Offers.prototype.push = function(name, params) {
8383
this._byName[name] = [];
8484

8585
this._byName[name].push(params);
86-
this._inOrder.push({name: name, params: params});
86+
this._inOrder.push({ name: name, params: params });
8787
};
8888

8989
Offers.prototype.eachOffer = function(callback, context) {

lib/pipeline/README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,11 @@ var crypto = require('crypto'),
124124
large = crypto.randomBytes(1 << 14),
125125
small = new Buffer('hi');
126126

127-
deflate.outgoing({data: large}, function() {
127+
deflate.outgoing({ data: large }, function() {
128128
console.log(1, 'large');
129129
});
130130

131-
deflate.outgoing({data: small}, function() {
131+
deflate.outgoing({ data: small }, function() {
132132
console.log(2, 'small');
133133
});
134134

@@ -205,7 +205,7 @@ order is preserved:
205205

206206
```js
207207
var stream = require('stream'),
208-
session = new stream.Transform({objectMode: true});
208+
session = new stream.Transform({ objectMode: true });
209209

210210
session._transform = function(message, _, callback) {
211211
var self = this;
@@ -276,11 +276,11 @@ above:
276276
```js
277277
var functor = new Functor(deflate, 'outgoing');
278278

279-
functor.call({data: large}, function() {
279+
functor.call({ data: large }, function() {
280280
console.log(1, 'large');
281281
});
282282

283-
functor.call({data: small}, function() {
283+
functor.call({ data: small }, function() {
284284
console.log(2, 'small');
285285
});
286286

lib/pipeline/functor.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Functor.QUEUE_SIZE = 8;
1515
Functor.prototype.call = function(error, message, callback, context) {
1616
if (this._stopped) return;
1717

18-
var record = {error: error, message: message, callback: callback, context: context, done: false},
18+
var record = { error: error, message: message, callback: callback, context: context, done: false },
1919
called = false,
2020
self = this;
2121

lib/pipeline/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ var Cell = require('./cell'),
55

66
var Pipeline = function(sessions) {
77
this._cells = sessions.map(function(session) { return new Cell(session) });
8-
this._stopped = {incoming: false, outgoing: false};
8+
this._stopped = { incoming: false, outgoing: false };
99
};
1010

1111
Pipeline.prototype.processIncomingMessage = function(message, callback, context) {
@@ -19,7 +19,7 @@ Pipeline.prototype.processOutgoingMessage = function(message, callback, context)
1919
};
2020

2121
Pipeline.prototype.close = function(callback, context) {
22-
this._stopped = {incoming: true, outgoing: true};
22+
this._stopped = { incoming: true, outgoing: true };
2323

2424
var closed = this._cells.map(function(a) { return a.close() });
2525
if (callback)

lib/websocket_extensions.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ var instance = {
112112
},
113113

114114
validFrameRsv: function(frame) {
115-
var allowed = {rsv1: false, rsv2: false, rsv3: false},
115+
var allowed = { rsv1: false, rsv2: false, rsv3: false },
116116
ext;
117117

118118
if (Extensions.MESSAGE_OPCODES.indexOf(frame.opcode) >= 0) {

spec/parser_spec.js

+19-19
Original file line numberDiff line numberDiff line change
@@ -20,56 +20,56 @@ test.describe("Parser", function() { with(this) {
2020
}})
2121

2222
it("parses one offer with no params", function() { with(this) {
23-
assertEqual( [{name: "a", params: {}}],
23+
assertEqual( [{ name: "a", params: {}}],
2424
parse('a') )
2525
}})
2626

2727
it("parses two offers with no params", function() { with(this) {
28-
assertEqual( [{name: "a", params: {}}, {name: "b", params: {}}],
28+
assertEqual( [{ name: "a", params: {}}, { name: "b", params: {}}],
2929
parse('a, b') )
3030
}})
3131

3232
it("parses a duplicate offer name", function() { with(this) {
33-
assertEqual( [{name: "a", params: {}}, {name: "a", params: {}}],
33+
assertEqual( [{ name: "a", params: {}}, { name: "a", params: {}}],
3434
parse('a, a') )
3535
}})
3636

3737
it("parses a flag", function() { with(this) {
38-
assertEqual( [{name: "a", params: {b: true}}],
38+
assertEqual( [{ name: "a", params: { b: true }}],
3939
parse('a; b') )
4040
}})
4141

4242
it("parses an unquoted param", function() { with(this) {
43-
assertEqual( [{name: "a", params: {b: 1}}],
43+
assertEqual( [{ name: "a", params: { b: 1 }}],
4444
parse('a; b=1') )
4545
}})
4646

4747
it("parses a quoted param", function() { with(this) {
48-
assertEqual( [{name: "a", params: {b: 'hi, "there'}}],
48+
assertEqual( [{ name: "a", params: { b: 'hi, "there' }}],
4949
parse('a; b="hi, \\"there"') )
5050
}})
5151

5252
it("parses multiple params", function() { with(this) {
53-
assertEqual( [{name: "a", params: {b: true, c: 1, d: 'hi'}}],
53+
assertEqual( [{ name: "a", params: { b: true, c: 1, d: 'hi' }}],
5454
parse('a; b; c=1; d="hi"') )
5555
}})
5656

5757
it("parses duplicate params", function() { with(this) {
58-
assertEqual( [{name: "a", params: {b: [true, 'hi'], c: 1}}],
58+
assertEqual( [{ name: "a", params: { b: [true, 'hi'], c: 1 }}],
5959
parse('a; b; c=1; b="hi"') )
6060
}})
6161

6262
it("parses multiple complex offers", function() { with(this) {
63-
assertEqual( [{name: "a", params: {b: 1}},
64-
{name: "c", params: {}},
65-
{name: "b", params: {d: true}},
66-
{name: "c", params: {e: ['hi, there', true]}},
67-
{name: "a", params: {b: true}}],
63+
assertEqual( [{ name: "a", params: { b: 1 }},
64+
{ name: "c", params: {}},
65+
{ name: "b", params: { d: true }},
66+
{ name: "c", params: { e: ['hi, there', true] }},
67+
{ name: "a", params: { b: true }}],
6868
parse('a; b=1, c, b; d, c; e="hi, there"; e, a; b') )
6969
}})
7070

7171
it("parses an extension name that shadows an Object property", function() { with(this) {
72-
assertEqual( [{name: "hasOwnProperty", params: {}}],
72+
assertEqual( [{ name: "hasOwnProperty", params: {}}],
7373
parse('hasOwnProperty') )
7474
}})
7575

@@ -86,23 +86,23 @@ test.describe("Parser", function() { with(this) {
8686
}})
8787

8888
it("serializes a flag", function() { with(this) {
89-
assertEqual( 'a; b', Parser.serializeParams('a', {b: true}) )
89+
assertEqual( 'a; b', Parser.serializeParams('a', { b: true }) )
9090
}})
9191

9292
it("serializes an unquoted param", function() { with(this) {
93-
assertEqual( 'a; b=42', Parser.serializeParams('a', {b: '42'}) )
93+
assertEqual( 'a; b=42', Parser.serializeParams('a', { b: '42' }) )
9494
}})
9595

9696
it("serializes a quoted param", function() { with(this) {
97-
assertEqual( 'a; b="hi, there"', Parser.serializeParams('a', {b: 'hi, there'}) )
97+
assertEqual( 'a; b="hi, there"', Parser.serializeParams('a', { b: 'hi, there' }) )
9898
}})
9999

100100
it("serializes multiple params", function() { with(this) {
101-
assertEqual( 'a; b; c=1; d=hi', Parser.serializeParams('a', {b: true, c: 1, d: 'hi'}) )
101+
assertEqual( 'a; b; c=1; d=hi', Parser.serializeParams('a', { b: true, c: 1, d: 'hi' }) )
102102
}})
103103

104104
it("serializes duplicate params", function() { with(this) {
105-
assertEqual( 'a; b; b=hi; c=1', Parser.serializeParams('a', {b: [true, 'hi'], c: 1}) )
105+
assertEqual( 'a; b; b=hi; c=1', Parser.serializeParams('a', { b: [true, 'hi'], c: 1 }) )
106106
}})
107107
}})
108108
}})

0 commit comments

Comments
 (0)