@@ -36,14 +36,7 @@ local util, parse = {}, {}
36
36
local F = require " plenary.functional"
37
37
local J = require " plenary.job"
38
38
local P = require " plenary.path"
39
-
40
- local flatten = function (t )
41
- if vim .fn .has " nvim-0.11" == 1 then
42
- return vim .iter (t ):flatten ():totable ()
43
- else
44
- return vim .tbl_flatten (t )
45
- end
46
- end
39
+ local compat = require " plenary.compat"
47
40
48
41
-- Utils ----------------------------------------------------
49
42
---- ---------------------------------------------------------
@@ -62,7 +55,7 @@ util.url_encode = function(str)
62
55
end
63
56
64
57
util .kv_to_list = function (kv , prefix , sep )
65
- return flatten (F .kv_map (function (kvp )
58
+ return compat . flatten (F .kv_map (function (kvp )
66
59
return { prefix , kvp [1 ] .. sep .. kvp [2 ] }
67
60
end , kv ))
68
61
end
@@ -251,7 +244,7 @@ parse.request = function(opts)
251
244
table.insert (result , { " -o" , opts .output })
252
245
end
253
246
table.insert (result , parse .url (opts .url , opts .query ))
254
- return flatten (result ), opts
247
+ return compat . flatten (result ), opts
255
248
end
256
249
257
250
-- Parse response ------------------------------------------
0 commit comments