| 1078 | } |
| 1079 | |
| 1080 | static napi_value decodeNumberSet(napi_env env, napi_callback_info info) { |
| 1081 | size_t argc = 3; |
| 1082 | napi_value args[3] = {nullptr}; |
| 1083 | NAPI_CALL(napi_get_cb_info(env, info, &argc, args, nullptr, nullptr)); |
| 1084 | |
| 1085 | auto handle = NValueToUInt64(env, args[0]); |
| 1086 | auto key = NValueToString(env, args[1]); |
| 1087 | MMKV *kv = reinterpret_cast<MMKV *>(handle); |
| 1088 | if (kv && key.length() > 0) { |
| 1089 | vector<double> result; |
| 1090 | if (kv->getVector(key, result)) { |
| 1091 | return DoubleArrayToNValue(env, result); |
| 1092 | } |
| 1093 | } |
| 1094 | return args[2]; |
| 1095 | } |
| 1096 | |
| 1097 | static napi_value encodeBoolSet(napi_env env, napi_callback_info info) { |
| 1098 | size_t argc = 4; |
nothing calls this directly
no test coverage detected