Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Will return metatable.__typename if present instead of always "table"
- __lazy = __lazy or {}
- if not __lazy.type then
- __lazy.type = type
- function type(var)
- local _type = __lazy.type(var);
- if(_type ~= "table" and _type ~= "userdata") then
- return _type;
- end
- local _meta = getmetatable(var);
- if(_meta ~= nil and _meta.__typename ~= nil) then
- return _meta.__typename;
- else
- return _type
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment