@nxtedition/rocksdb 5.2.28 → 5.2.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/binding.cc
CHANGED
|
@@ -167,19 +167,6 @@ static std::string StringProperty(napi_env env,
|
|
|
167
167
|
return defaultValue;
|
|
168
168
|
}
|
|
169
169
|
|
|
170
|
-
static size_t StringOrBufferLength(napi_env env, napi_value value) {
|
|
171
|
-
size_t size = 0;
|
|
172
|
-
|
|
173
|
-
if (IsString(env, value)) {
|
|
174
|
-
napi_get_value_string_utf8(env, value, nullptr, 0, &size);
|
|
175
|
-
} else if (IsBuffer(env, value)) {
|
|
176
|
-
char* buf = nullptr;
|
|
177
|
-
napi_get_buffer_info(env, value, (void**)&buf, &size);
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
return size;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
170
|
static std::optional<std::string> RangeOption(napi_env env, napi_value opts, const std::string_view& name) {
|
|
184
171
|
if (HasProperty(env, opts, name)) {
|
|
185
172
|
const auto value = GetProperty(env, opts, name);
|
|
@@ -190,9 +177,20 @@ static std::optional<std::string> RangeOption(napi_env env, napi_value opts, con
|
|
|
190
177
|
}
|
|
191
178
|
|
|
192
179
|
static napi_status CallFunction(napi_env env, napi_value callback, const int argc, napi_value* argv) {
|
|
180
|
+
napi_status status;
|
|
193
181
|
napi_value global;
|
|
194
|
-
|
|
195
|
-
|
|
182
|
+
|
|
183
|
+
status = napi_get_global(env, &global);
|
|
184
|
+
if (status != napi_ok) {
|
|
185
|
+
return status;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
status = napi_call_function(env, global, callback, argc, argv, nullptr);
|
|
189
|
+
if (status != napi_ok) {
|
|
190
|
+
return status;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
return napi_ok;
|
|
196
194
|
}
|
|
197
195
|
|
|
198
196
|
static napi_value ToError(napi_env env, const rocksdb::Status& status) {
|
|
@@ -222,11 +220,11 @@ static napi_value ToError(napi_env env, const rocksdb::Status& status) {
|
|
|
222
220
|
}
|
|
223
221
|
|
|
224
222
|
template <typename T>
|
|
225
|
-
|
|
223
|
+
napi_status Convert(napi_env env, const T& s, bool asBuffer, napi_value& result) {
|
|
226
224
|
if (asBuffer) {
|
|
227
|
-
napi_create_buffer_copy(env, s.size(), s.data(), nullptr, &result);
|
|
225
|
+
return napi_create_buffer_copy(env, s.size(), s.data(), nullptr, &result);
|
|
228
226
|
} else {
|
|
229
|
-
napi_create_string_utf8(env, s.data(), s.size(), &result);
|
|
227
|
+
return napi_create_string_utf8(env, s.data(), s.size(), &result);
|
|
230
228
|
}
|
|
231
229
|
}
|
|
232
230
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nxtedition/rocksdb",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.33",
|
|
4
4
|
"description": "A low-level Node.js RocksDB binding",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "index.js",
|
|
@@ -12,17 +12,17 @@
|
|
|
12
12
|
"test-prebuild": "cross-env PREBUILDS_ONLY=1 npm t",
|
|
13
13
|
"coverage": "nyc report -r lcovonly",
|
|
14
14
|
"rebuild": "npm run install --build-from-source",
|
|
15
|
-
"prebuild": "prebuildify -t
|
|
15
|
+
"prebuild": "prebuildify -t -t 8.14.0 --napi --strip",
|
|
16
16
|
"download-prebuilds": "prebuildify-ci download",
|
|
17
17
|
"hallmark": "hallmark --fix",
|
|
18
18
|
"dependency-check": "dependency-check --no-dev -i napi-macros . test/*.js",
|
|
19
19
|
"prepublishOnly": "npm run dependency-check",
|
|
20
|
-
"prebuild-linux-arm": "prebuildify-cross -i linux-armv6 -i linux-armv7 -i linux-arm64 -t
|
|
21
|
-
"prebuild-android-arm": "prebuildify-cross -i android-armv7 -i android-arm64 -t
|
|
22
|
-
"prebuild-linux-x64": "prebuildify-cross -i centos7-devtoolset7 -i alpine -t
|
|
23
|
-
"prebuild-darwin-x64+arm64": "prebuildify -t
|
|
24
|
-
"prebuild-win32-x86": "prebuildify -t
|
|
25
|
-
"prebuild-win32-x64": "prebuildify -t
|
|
20
|
+
"prebuild-linux-arm": "prebuildify-cross -i linux-armv6 -i linux-armv7 -i linux-arm64 -t -t 8.14.0 --napi --strip",
|
|
21
|
+
"prebuild-android-arm": "prebuildify-cross -i android-armv7 -i android-arm64 -t -t 8.14.0 --napi --strip",
|
|
22
|
+
"prebuild-linux-x64": "prebuildify-cross -i centos7-devtoolset7 -i alpine -t -t 8.14.0 --napi --strip",
|
|
23
|
+
"prebuild-darwin-x64+arm64": "prebuildify -t -t 8.14.0 --napi --strip --arch x64+arm64",
|
|
24
|
+
"prebuild-win32-x86": "prebuildify -t -t 8.14.0 --napi --strip",
|
|
25
|
+
"prebuild-win32-x64": "prebuildify -t -t 8.14.0 --napi --strip"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"abstract-level": "^1.0.2",
|
|
index 78a6d0c..9bb9151 100755
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|