Tencent / MMKV

An efficient, small mobile key-value storage framework developed by WeChat. Works on Android, iOS, macOS, Windows, and POSIX.
Other
17.1k stars 1.88k forks source link

MMKV decodeDouble decodeBool api问题 #1316

Closed CheerHarry closed 1 month ago

CheerHarry commented 1 month ago

目前遇到一场景,假如我调用: MMKV.encodeString("string_key", "测试一下")

然后通过以下方式获取值:

方式一: let n = MMKV.decodeDouble("string_key")

发现 n = -3.4328893225396805e+176

方式二:

let b = MMKV.decodeBool("string_key")

发现 b = true

实际开发中,希望n和b返回undefined或者设置的默认值

lingol commented 1 month ago

Can't be done. The reason is the same as why gatAll() not exists. #1313