| 1431 | } |
| 1432 | |
| 1433 | static napi_value getValueSize(napi_env env, napi_callback_info info) { |
| 1434 | size_t argc = 3; |
| 1435 | napi_value args[3] = {nullptr}; |
| 1436 | NAPI_CALL(napi_get_cb_info(env, info, &argc, args, nullptr, nullptr)); |
| 1437 | |
| 1438 | auto handle = NValueToUInt64(env, args[0]); |
| 1439 | auto key = NValueToString(env, args[1]); |
| 1440 | MMKV *kv = reinterpret_cast<MMKV *>(handle); |
| 1441 | if (kv && key.length() > 0) { |
| 1442 | auto actualSize = NValueToBool(env, args[2]); |
| 1443 | return UInt32ToNValue(env, kv->getValueSize(key, actualSize)); |
| 1444 | } |
| 1445 | return NAPIUndefined(env); |
| 1446 | } |
| 1447 | |
| 1448 | static napi_value trim(napi_env env, napi_callback_info info) { |
| 1449 | size_t argc = 1; |
nothing calls this directly
no test coverage detected