feat(client/api): Add zones single option support
Add single option and option type checks to zones api
This PR addresses the issue where the zones api would not have the same single option support nor do the same options type checks as the functions that use addTarget
Changes Made
- Moved
typeErrorfunction to the top of the file - Moved the
addTargetoptions type checks into its owncheckOptionsfunction at the top of the file - Use
checkOptionsinaddPolyZone,addBoxZone,addSphereZone,addTarget
Testing
- Tested
addBoxZoneandaddModelwith:- Wrong type, empty table, single option, array of options
Not a fix though.
I only added options support because I got sick of people renaming qtarget/qbtarget exports and keeping the format the same. Zones never had that.
I wasnt sure if it was a fix or a new feature. went with fix because I thought maybe it got overlooked. For consistency I think it should be supported, but if not then maybe something in the docs mentioning different functionality between zones and entities
I don't even think docs mention the hashmap being valid for options arg. Considering the number of numbskulls constantly complaining about such a dumb and well documented thing I don't mind merging but it's really more of a feature.
~~Docs just mention table~~
Updated the title
Edit: In the options page it does mention array of options but the variable options under each function just say table