| 1040 | } |
| 1041 | |
| 1042 | static napi_value decodeStringSet(napi_env env, napi_callback_info info) { |
| 1043 | size_t argc = 3; |
| 1044 | napi_value args[3] = {nullptr}; |
| 1045 | NAPI_CALL(napi_get_cb_info(env, info, &argc, args, nullptr, nullptr)); |
| 1046 | |
| 1047 | auto handle = NValueToUInt64(env, args[0]); |
| 1048 | auto key = NValueToString(env, args[1]); |
| 1049 | MMKV *kv = reinterpret_cast<MMKV *>(handle); |
| 1050 | if (kv && key.length() > 0) { |
| 1051 | vector<string> result; |
| 1052 | if (kv->getVector(key, result)) { |
| 1053 | return StringArrayToNValue(env, result); |
| 1054 | } |
| 1055 | } |
| 1056 | return args[2]; |
| 1057 | } |
| 1058 | |
| 1059 | static napi_value encodeNumberSet(napi_env env, napi_callback_info info) { |
| 1060 | size_t argc = 4; |
nothing calls this directly
no test coverage detected