v2 / vlib / x / json2 / decoder2 / stub.v
17 lines · 14 sloc · 572 bytes · 3ffc951cf555dc4818309a507ccb9d0da4de748f
Raw
1module decoder2
2
3import x.json2
4
5// decode decodes a JSON string into a specified type.
6@[deprecated: '`decode` has been moved to `x.json2`, use `decode` from `x.json2` instead']
7@[deprecated_after: '2025-10-12']
8pub fn decode[T](val string) !T {
9 return json2.decode[T](val)!
10}
11
12// decode_array decodes a JSON string into a specified type. This is the same as decode.
13@[deprecated: '`decode_array` has been moved to `x.json2`, use `decode` from `x.json2` instead']
14@[deprecated_after: '2025-03-18']
15pub fn decode_array[T](src string) !T {
16 return json2.decode[T](src)!
17}
18