We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dd9391d commit d207008Copy full SHA for d207008
spec/util_spec.moon
@@ -155,6 +155,28 @@ tests = {
155
'{"nothing":null}'
156
}
157
158
+ { -- encoding empty array with array_mt
159
+ ->
160
+ util.to_json {
161
+ items: setmetatable {}, json.array_mt
162
+ }
163
+ '{"items":[]}'
164
165
+
166
+ { -- encoding non-empty array with array_mt
167
168
169
+ items: setmetatable {1, 2, 3}, json.array_mt
170
171
+ '{"items":[1,2,3]}'
172
173
174
+ { -- encoding top-level empty array with array_mt
175
176
+ util.to_json setmetatable({}, json.array_mt)
177
+ '[]'
178
179
180
{
181
->
182
util.build_url {
0 commit comments