[Request] types.map_of(key_type, value_type)
Nayruden opened this issue · comments
Please add types.maps_of(...)
, which could be used as follows
local dictionary_shape = types.map_of(types.string, types.string)
assert(dictionary_shape:check_value({"apple"="red", "watermelon"="green"}))
-- error: item 'shoe' in map does not match: got type `number`, expected `string`
assert(dictionary_shape:check_value({"apple"="red", "watermelon"="green", "shoe"=4}))
The error is notional.
opening again to remind me to write docs
new version released