Hi so, I just wanted to test out my skills with this module and it was cool making my own module this took about 3 days to make but the main features are listed on this website. The repo on git hub can be found here
The main focus of this module is to reduce the amount of code needed for searching within dictionaries and common dictionary features. This will also work for deep dicts. This module also comes with .changed which acts like a RBXScriptSignal more details can be found on the website.
WARNING THIS ONLY WORKS ON DICTIONARIES
If you use this with an array it will error so be careful.
This is all open source i don’t mind sharing the code any suggestions, errors and features you would like to see can be asked under this or open up an issue on GitHub and I will get on it.
P.S: I know some things like .find can be done easily but this can be handy when dealing with large dicts.
What benefit does this module have over these built-in alternatives? (Also, having it on Github as an .rbxlx or .lua allows for easier PR submission since the code is more directly viewable.)
Well i just thought that i would make it open sourced of course you could use the regular ways but this is much simpler for people who are just getting started yet it offers functions that are extended for more power users.
The only two functions are getn and changed as i realized that other functions didn’t have much use, i will update the git hub page soon!
Instead of pcalling i know use assert to check if the given argument is proper, I have also fixed the cases of when getn did return -1 of the amount of keys that you had.
Also sorry for the one month fix, i had lots of school work to do
Not to be rude, but this is made pretty poorly and I don’t understand the purpose of this module. There’s more to this than what @sjr04 pointed out about the pcall.
Why are you iterating to see if a key exists? Not only that, but in your for loop you check if find is in the dictionary every iteration. Basically, you just made dictionary lookups inefficient. If the key doesn’t happen to exist, no matter what it will look through every key.