FrigadeHQ / remote-storage

remoteStorage is a simple library that combines the localStorage API with a remote server to persist data across sessions, devices, and browsers. It works as a simple key value database store and backend with support for React, Next.js, Vue, Node, or any Javascript stack
https://remote.storage
MIT License
1.21k stars 27 forks source link

Array-based value stored as a string #25

Closed calebmpeterson closed 7 months ago

calebmpeterson commented 7 months ago

Can this condition be expanded to consider strings starting with '[' as well so that setItem('my-key', [0, 1, 2]) can be read with subsequent getItem('my-key') calls as an Array instead of a string?

calebmpeterson commented 7 months ago

I'm happy to submit a PR if this is an acceptable change.

christianmat commented 7 months ago

@calebmpeterson thanks for calling this out, yes that's definitely a bug. Feel free to open a PR to fix this.

calebmpeterson commented 7 months ago

PR opened: https://github.com/FrigadeHQ/remote-storage/pull/26

christianmat commented 7 months ago

Appreciate the fix. This is now released in remote-storage@1.0.5