k2hash 2.0.0 → 2.0.1

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.gyp CHANGED
@@ -14,7 +14,7 @@
14
14
  "src/k2h_cbs.cc"
15
15
  ],
16
16
  "include_dirs": [
17
- "<!(node -p \"require('node-addon-api').include\")",
17
+ "<!(node -e \"incpath = require('node-addon-api').include; if(incpath.length && incpath[0] === '\\\"' && incpath[incpath.length - 1] === '\\\"') incpath = incpath.slice(1, -1); process.stdout.write(incpath)\")",
18
18
  "<(module_root_dir)/node_modules/node-addon-api"
19
19
  ],
20
20
  "dependencies": [
@@ -46,7 +46,7 @@
46
46
  "src/k2h_cbs.cc"
47
47
  ],
48
48
  "include_dirs": [
49
- "<!(node -p \"require('node-addon-api').include\")",
49
+ "<!(node -e \"incpath = require('node-addon-api').include; if(incpath.length && incpath[0] === '\\\"' && incpath[incpath.length - 1] === '\\\"') incpath = incpath.slice(1, -1); process.stdout.write(incpath)\")",
50
50
  "<(module_root_dir)/node_modules/node-addon-api"
51
51
  ],
52
52
  "dependencies": [
@@ -78,7 +78,7 @@
78
78
  "src/k2h_cbs.cc"
79
79
  ],
80
80
  "include_dirs": [
81
- "<!(node -p \"require('node-addon-api').include\")",
81
+ "<!(node -e \"incpath = require('node-addon-api').include; if(incpath.length && incpath[0] === '\\\"' && incpath[incpath.length - 1] === '\\\"') incpath = incpath.slice(1, -1); process.stdout.write(incpath)\")",
82
82
  "<(module_root_dir)/node_modules/node-addon-api"
83
83
  ],
84
84
  "dependencies": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "k2hash",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "K2HASH addon library for Node.js",
5
5
  "os": "linux",
6
6
  "main": "index.js",
@@ -301,12 +301,7 @@ class GetValueAsyncWorker : public Napi::AsyncWorker
301
301
  if(sk){
302
302
  strarr_t strarr;
303
303
  sk->StringArray(strarr);
304
- for(const auto &_str : strarr){
305
- if(_str == _strsubkey){
306
- found = true;
307
- break;
308
- }
309
- }
304
+ found = std::any_of(strarr.begin(), strarr.end(), [&](const auto &_str){ return _str == _strsubkey; });
310
305
  delete sk;
311
306
  }
312
307
  if(!found){