-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Variation without the shims? #145
Milestone
Comments
OK, I just saw #95. Can I use 2.0.2 version of this library to resolve my issue? Would I be missing out on major bug fixes and such? The collection I am most interested in is sorted set. |
@srinivas-os Yes, version 2 should suffice for SortedSet sans shims. |
Closed
Duplicate #185 |
This was referenced Apr 15, 2019
This was referenced Apr 15, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Firstly, apologies in advance for my tone and naivete if any. English is not my first language, nor is Javascript :-).
I use this excellent library in conjunction with LoopbackJS. When I do JSON.stringify of a loopback model object, the array attributes are output in object form instead of array form (i.e. flower brackets {} in the JSON as opposed to square brackets []).
On deeper inspection, I found that Loopback is calling toObject method on all model attributes (including array attributes), when JSON.stringify is done. Since normally Array type in JS does not have toObject implemented, it gets ignored silently, and array's default JSON representation ([]) is used. But since the collectionsJS library shims Array with a bunch of methods including toObject, call goes there instead and the array is converted to an object.
I could instead file a request with LoopbackJS team to not call toObject for arrays. But I am not sure if this shimming affects other modules as well in other unknown ways.
Would it be possible to release a version of your wonderful CollectionsJS library without the shims? Or is there already such a fork? I would really hate to look for other libraries or cook up my own implementation of the various data structures just because I want to avoid the shims.
The text was updated successfully, but these errors were encountered: