@@ -5,13 +5,13 @@ export const types = {
5
5
string : {
6
6
to : 25 ,
7
7
from : null , // defaults to string
8
- serialize : x => '' + x // eslint-disable-line
8
+ serialize : x => '' + x
9
9
} ,
10
10
number : {
11
11
to : 1700 ,
12
12
from : [ 20 , 21 , 23 , 26 , 700 , 701 , 790 , 1700 ] ,
13
- serialize : x => '' + x , // eslint-disable-line
14
- parse : x => + x // eslint-disable-line
13
+ serialize : x => '' + x ,
14
+ parse : x => + x
15
15
} ,
16
16
json : {
17
17
to : 3802 ,
@@ -53,7 +53,7 @@ export function mergeUserTypes(types) {
53
53
}
54
54
55
55
function typeHandlers ( types ) {
56
- return Object . entries ( types ) . reduce ( ( acc , [ name , type ] ) => {
56
+ return Object . entries ( types ) . reduce ( ( acc , [ , type ] ) => {
57
57
type . from && type . from . forEach ( x => acc . parsers [ x ] = type . parse )
58
58
acc . serializers [ type . to ] = type . serialize
59
59
return acc
@@ -94,7 +94,9 @@ export function arraySerializer(xs, serializer) {
94
94
if ( Array . isArray ( first ) && ! first . type )
95
95
return '{' + xs . map ( x => arraySerializer ( x , serializer ) ) . join ( ',' ) + '}'
96
96
97
- return '{' + xs . map ( x => '"' + arrayEscape ( serializer ? serializer ( x . type ? x . value : x ) : '' + x ) + '"' ) . join ( ',' ) + '}'
97
+ return '{' + xs . map ( x =>
98
+ '"' + arrayEscape ( serializer ? serializer ( x . type ? x . value : x ) : '' + x ) + '"'
99
+ ) . join ( ',' ) + '}'
98
100
}
99
101
100
102
const arrayParserState = {
0 commit comments