11/**
2- * @file Generated by js-routes 2.3.5 . Based on Rails 8.1.1 routes of ReactStarterKit::Application.
2+ * @file Generated by js-routes 2.3.6 . Based on Rails 8.1.1 routes of ReactStarterKit::Application.
33 * @version 743c630cafd479b5d9ad42a7803e8be1fdeb9448419ce21d215b267e2b0ae749
44 * @see https://github.com/railsware/js-routes
55 */
@@ -127,9 +127,6 @@ const __jsr = (
127127 } ;
128128 }
129129 default_serializer ( value , prefix ) {
130- if ( this . is_nullable ( value ) ) {
131- return "" ;
132- }
133130 if ( ! prefix && ! this . is_object ( value ) ) {
134131 throw new Error ( "Url parameters should be a javascript hash" ) ;
135132 }
@@ -145,21 +142,22 @@ const __jsr = (
145142 if ( ! hasProp ( value , key ) )
146143 continue ;
147144 let prop = value [ key ] ;
148- if ( this . is_nullable ( prop ) && prefix ) {
149- prop = " ";
145+ if ( prefix ) {
146+ key = prefix + "[" + key + "] ";
150147 }
151- if ( this . is_not_nullable ( prop ) ) {
152- if ( prefix ) {
153- key = prefix + "[" + key + "]" ;
154- }
155- result . push ( this . default_serializer ( prop , key ) ) ;
148+ const subvalue = this . default_serializer ( prop , key ) ;
149+ if ( subvalue . length ) {
150+ result . push ( subvalue ) ;
156151 }
157152 }
158153 }
159154 else {
160- if ( this . is_not_nullable ( value ) ) {
161- result . push ( encodeURIComponent ( prefix ) + "=" + encodeURIComponent ( "" + value ) ) ;
162- }
155+ result . push ( this . is_not_nullable ( value ) ||
156+ false
157+ ? encodeURIComponent ( prefix ) +
158+ "=" +
159+ encodeURIComponent ( "" + ( value !== null && value !== void 0 ? value : "" ) )
160+ : encodeURIComponent ( prefix ) ) ;
163161 }
164162 return result . join ( "&" ) ;
165163 }
0 commit comments