return nil
end
+ local function maybe_register_selector()
+ if opt.selector_alias then
+ local lua_selectors = require "lua_selectors"
+ lua_selectors.add_map(opt.selector_alias, ret)
+ end
+ end
+
if type(opt) == 'string' then
opt,mtype = maybe_adjust_type(opt, mtype)
local cache_key = map_hash_key(opt, mtype)
ret.__data = map
setmetatable(ret, ret_mt)
maps_cache[cache_key] = ret
+ maybe_register_selector()
+
return ret
end
else
ret.__data = map
setmetatable(ret, ret_mt)
maps_cache[cache_key] = ret
+ maybe_register_selector()
+
return ret
end
end
ret.__data = map
setmetatable(ret, ret_mt)
maps_cache[cache_key] = ret
+ maybe_register_selector()
+
return ret
end
else
ret.__data = map
setmetatable(ret, ret_mt)
maps_cache[cache_key] = ret
+ maybe_register_selector()
+
return ret
end
end
ret.__data = map
setmetatable(ret, ret_mt)
maps_cache[cache_key] = ret
+ maybe_register_selector()
+
return ret
end
else
end
maps_cache[cache_key] = ret
+ maybe_register_selector()
+
return ret
else
-- Empty map, huh?
ret.__data = opt
ret.__external = true
setmetatable(ret, ret_mt)
+ maybe_register_selector()
return ret
else
ret.__data = map
setmetatable(ret, ret_mt)
maps_cache[cache_key] = ret
+ maybe_register_selector()
+
return ret
end
end
local direct_map_schema = ts.shape{ -- complex object
name = ts.string:is_optional(),
description = ts.string:is_optional(),
+ selector_alias = ts.string:is_optional(), -- an optional alias for the selectos framework
timeout = ts.number,
data = ts.array_of(ts.string):is_optional(),
-- Tableshape has no options support for something like key1 or key2?