Skip to content

Commit c6e577f

Browse files
Fix declare identificator for params and rendering object types routers
PR-URL: #12 Co-authored-by: Timur Shemsedinov <timur.shemsedinov@gmail.com>
1 parent 70b6a59 commit c6e577f

File tree

11 files changed

+12
-12
lines changed

11 files changed

+12
-12
lines changed

http2-ws/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const routing = {
2525
};
2626

2727
const types = {
28-
object: JSON.stringify,
28+
object: (o) => JSON.stringify(o),
2929
string: (s) => s,
3030
undefined: () => 'not found',
3131
function: (fn, req, res) => JSON.stringify(fn(req, res)),

native-advanced/server.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const routing = {
1414
};
1515

1616
const types = {
17-
object: JSON.stringify,
17+
object: (o) => JSON.stringify(o),
1818
string: (s) => s,
1919
number: (n) => n + '',
2020
undefined: () => 'not found',
@@ -34,7 +34,7 @@ for (const key in routing) {
3434
const router = (client) => {
3535
const { url } = client.req;
3636
let route = routing[url];
37-
const params = [];
37+
let params = [];
3838
if (!route) {
3939
for (const rx of matching) {
4040
params = url.match(rx[0]);

native-cluster/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const routing = {
1717
};
1818

1919
const types = {
20-
object: JSON.stringify,
20+
object: (o) => JSON.stringify(o),
2121
string: (s) => s,
2222
number: (n) => n.toString(),
2323
undefined: () => 'not found',

native-cp/worker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const routing = {
1717
};
1818

1919
const types = {
20-
object: JSON.stringify,
20+
object: (o) => JSON.stringify(o),
2121
string: (s) => s,
2222
number: (n) => n.toString(),
2323
undefined: () => 'not found',

native-http2-alpn/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const routing = {
2323
};
2424

2525
const types = {
26-
object: JSON.stringify,
26+
object: (o) => JSON.stringify(o),
2727
string: (s) => s,
2828
undefined: () => 'not found',
2929
function: (fn, req, res) => JSON.stringify(fn(req, res)),

native-http2-compat/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const routing = {
2323
};
2424

2525
const types = {
26-
object: JSON.stringify,
26+
object: (o) => JSON.stringify(o),
2727
string: (s) => s,
2828
undefined: () => 'not found',
2929
function: (fn, req, res) => JSON.stringify(fn(req, res)),

native-http2/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const routing = {
2323
};
2424

2525
const types = {
26-
object: JSON.stringify,
26+
object: (o) => JSON.stringify(o),
2727
string: (s) => s,
2828
undefined: () => 'not found',
2929
function: (fn, stream, headers) => JSON.stringify(fn(stream, headers)),

native-https/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const routing = {
2323
};
2424

2525
const types = {
26-
object: JSON.stringify,
26+
object: (o) => JSON.stringify(o),
2727
string: (s) => s,
2828
undefined: () => 'not found',
2929
function: (fn, req, res) => JSON.stringify(fn(req, res)),

native-multidomain/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const routing = {
2323
};
2424

2525
const types = {
26-
object: JSON.stringify,
26+
object: (o) => JSON.stringify(o),
2727
string: (s) => s,
2828
undefined: () => 'not found',
2929
function: (fn, req, res) => JSON.stringify(fn(req, res)),

native-simple/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const routing = {
2222
};
2323

2424
const types = {
25-
object: JSON.stringify,
25+
object: (o) => JSON.stringify(o),
2626
string: (s) => s,
2727
undefined: () => 'not found',
2828
function: (fn, req, res) => JSON.stringify(fn(req, res)),

0 commit comments

Comments
 (0)