k2hash 2.0.4 → 2.0.6

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.
@@ -182,6 +182,11 @@ check_and_download_asset_file()
182
182
  PRNINFO "Not found ${ASSET_TGZ_FILENAME} file."
183
183
  return 1
184
184
  fi
185
+ if ! tar tvfz "${SRCTOP}/${ASSET_TGZ_FILENAME}" >/dev/null 2>&1; then
186
+ PRNINFO "${ASSET_TGZ_FILENAME} file is not tar.gz format."
187
+ rm -f "${SRCTOP}/${ASSET_TGZ_FILENAME}" 2>/dev/null
188
+ return 1
189
+ fi
185
190
  if ! _RESULT_CODE=$("${CURLCMD}" -s -S -L -w '%{http_code}' -o "${SRCTOP}/${ASSET_SHA256_FILENAME}" -X GET "${ASSET_SHA256_DOWNLOAD_URL}" --insecure); then
186
191
  PRNINFO "Failed to get sha256 file(${ASSET_SHA256_FILENAME})."
187
192
  rm -f "${SRCTOP}/${ASSET_SHA256_FILENAME}" 2>/dev/null
@@ -203,10 +208,14 @@ check_and_download_asset_file()
203
208
  SHA256_VALUE=$(awk '{print $1}' "${SRCTOP}/${ASSET_SHA256_FILENAME}" 2>/dev/null | tr -d '\n')
204
209
  if ! DL_TGZ_SHA256_VALUE=$(sha256sum "${SRCTOP}/${ASSET_TGZ_FILENAME}" 2>/dev/null | awk '{print $1}' 2>/dev/null | tr -d '\n'); then
205
210
  PRNINFO "Failed to make sha256 value from download tgz file."
211
+ rm -f "${SRCTOP}/${ASSET_TGZ_FILENAME}" 2>/dev/null
212
+ rm -f "${SRCTOP}/${ASSET_SHA256_FILENAME}" 2>/dev/null
206
213
  return 1
207
214
  fi
208
215
  if [ -z "${SHA256_VALUE}" ] || [ -z "${DL_TGZ_SHA256_VALUE}" ] || [ "${SHA256_VALUE}" != "${DL_TGZ_SHA256_VALUE}" ]; then
209
216
  PRNINFO "The sha256 value of the downloaded tgz file is incorrect."
217
+ rm -f "${SRCTOP}/${ASSET_TGZ_FILENAME}" 2>/dev/null
218
+ rm -f "${SRCTOP}/${ASSET_SHA256_FILENAME}" 2>/dev/null
210
219
  return 1
211
220
  fi
212
221
 
@@ -217,6 +226,8 @@ check_and_download_asset_file()
217
226
  cd "${SRCTOP}" || exit 1
218
227
  if ! tar xvfz "${SRCTOP}/${ASSET_TGZ_FILENAME}" >/dev/null 2>&1; then
219
228
  PRNINFO "Could not extract files from ${ASSET_TGZ_FILENAME} file."
229
+ rm -f "${SRCTOP}/${ASSET_TGZ_FILENAME}" 2>/dev/null
230
+ rm -f "${SRCTOP}/${ASSET_SHA256_FILENAME}" 2>/dev/null
220
231
  cd "${_CUR_DIR}" || exit 1
221
232
  return 1
222
233
  fi
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "k2hash",
3
- "version": "2.0.4",
3
+ "version": "2.0.6",
4
4
  "description": "K2HASH addon library for Node.js",
5
5
  "os": "linux",
6
6
  "main": "index.js",
@@ -27,7 +27,7 @@
27
27
  ],
28
28
  "dependencies": {
29
29
  "bindings": "^1.5.0",
30
- "node-addon-api": "^8.6.0",
30
+ "node-addon-api": "^8.7.0",
31
31
  "prebuild-install": "^7.1.3"
32
32
  },
33
33
  "devDependencies": {
@@ -37,18 +37,18 @@
37
37
  "@rollup/plugin-terser": "^1.0.0",
38
38
  "@types/chai": "^5.2.3",
39
39
  "@types/mocha": "^10.0.10",
40
- "@types/node": "^25.5.0",
40
+ "@types/node": "^25.6.0",
41
41
  "chai": "^6.2.2",
42
42
  "mocha": "^11.7.5",
43
- "node-gyp": "^12.2.0",
43
+ "node-gyp": "^12.3.0",
44
44
  "prebuild": "^13.0.1",
45
- "rollup": "^4.59.0",
45
+ "rollup": "^4.60.2",
46
46
  "typescript": "^5.9.3",
47
47
  "ts-node": "^10.9.2"
48
48
  },
49
49
  "scripts": {
50
50
  "help": "echo 'command list:\n npm run install\n npm run install:onlypackages\n npm run build\n npm run build:ts\n npm run build:ts:cjs\n npm run build:ts:esm\n npm run build:ts:tests:cjs\n npm run build:types\n npm run build:checktypes\n npm run build:configure\n npm run build:rebuild\n npm run build:prebuild\n npm run build:prebuild:pure\n npm run build:bundle:esm\n npm run prepublishOnly\n npm run lint\n npm run test\n npm run test:ci\n npm run test:all\n npm run test:smoke\n npm run test:smoke:cjs\n npm run test:smoke:esm\n npm run test:smoke:ts\n npm run test:k2hash\n npm run test:k2hqueue\n npm run test:k2hkeyqueue\n'",
51
- "install": "export NPM_CONFIG_LOGLEVEL=silent && echo '[START] Install' && ./buildutils/node_prebuild_install.sh || (echo '[INFO] No binaries found, so building from source\n' && if [ -d build/cjs ] && [ -d build/esm ]; then npm run build:rebuild; else npm run build; fi) && echo '-> [DONE] Install\n'",
51
+ "install": "export NPM_CONFIG_LOGLEVEL=silent && echo '[START] Install' && ./buildutils/node_prebuild_install.sh || (echo '[INFO] No binaries found, so building from source\n' && if [ -d build/cjs ] && [ -d build/esm ]; then mv build/cjs ./cjs.backup; mv build/esm ./esm.backup; npm run build:rebuild; rm -rf build/cjs.backup build/esm; mv ./cjs.backup build/cjs; mv ./esm.backup build/esm; else npm run build; fi) && echo '-> [DONE] Install\n'",
52
52
  "install:onlypackages": "export NPM_CONFIG_LOGLEVEL=silent && echo '[START] Install:onlypackages' && npm install --ignore-scripts && echo '-> [DONE] Install:onlypackages\n'",
53
53
  "build": "export NPM_CONFIG_LOGLEVEL=silent && echo '[START] Build' && npm run build:checktypes && npm run build:configure && npm run build:rebuild && npm run build:ts && echo '-> [DONE] Build\n'",
54
54
  "build:ts": "export NPM_CONFIG_LOGLEVEL=silent && echo '[START] Build:ts' && npm run build:ts:cjs && npm run build:ts:esm && echo '-> [DONE] Build:ts\n'",
@@ -148,6 +148,8 @@ void K2hKeyQueue::Init(Napi::Env env, Napi::Object exports)
148
148
  //
149
149
  }
150
150
 
151
+ // cppcheck-suppress unmatchedSuppression
152
+ // cppcheck-suppress functionStatic
151
153
  Napi::Value K2hKeyQueue::New(const Napi::CallbackInfo& info)
152
154
  {
153
155
  if(info.IsConstructCall()){
package/src/k2h_queue.cc CHANGED
@@ -149,6 +149,8 @@ void K2hQueue::Init(Napi::Env env, Napi::Object exports)
149
149
  //
150
150
  }
151
151
 
152
+ // cppcheck-suppress unmatchedSuppression
153
+ // cppcheck-suppress functionStatic
152
154
  Napi::Value K2hQueue::New(const Napi::CallbackInfo& info)
153
155
  {
154
156
  if(info.IsConstructCall()){
package/src/k2h_shm.cc CHANGED
@@ -286,6 +286,8 @@ void K2hNode::Init(Napi::Env env, Napi::Object exports)
286
286
  //
287
287
  }
288
288
 
289
+ // cppcheck-suppress unmatchedSuppression
290
+ // cppcheck-suppress functionStatic
289
291
  Napi::Value K2hNode::New(const Napi::CallbackInfo& info)
290
292
  {
291
293
  if(info.IsConstructCall()){