Closed libinvarghese closed 6 years ago
TESTS SUITES FAILING.
The string spec specifically!
It breaks functionality and from my basic look: This commit is not complete. I can see that you have updated the setter but not the getter, which quite possibly is the reason.
Btw to add on, I think setItem currently is able to add and retrieve strings correctly now. What you are trying to do is an enhancement :)
What you are trying to do can save us one cycle of stringify/parse but I don't think the performance impact here is high enough except for extremely large volumes of read/writes per second. (though I think I/O will be your harder hitting bottleneck)
Also, the getter complexity might increase drastically because different platforms have different languages and datatype support underneath - ObjC, Java etc which could possibly increase the complexity that side. (this part is the missing part of this merge) .
@GillesC we discussed this from v1 --> v2. Do, comment if you think we should go this route.
Do note: Please complete & test the branch on your fork, before sending in a PR :)
Unfortunately, I have to close this request now.
If you feel otherwise, simply open an issue with your thoughts on why you need this feature (feature-request/enhancement), we can discuss and help you with a new PR :)
Currently
setItem(key, "stringValue")
will store the value"\"stringValue\""
intokey
.This commit avoids
JSON.stringify
if value is of typestring
.Since this is a generic method, that is expected to support all value type and is the only setter method supported in @ionic-native, this commit helps in storing string values.