From 2f32ed0248d7b1688cf7cafa10d8872b867b06dc Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Mon, 7 Jul 2025 10:08:46 +0300 Subject: [PATCH] Update dependencies and fix build --- package.json | 13 ++++++------- test/native_tests.cc | 5 ++--- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 3422913..3eacdc9 100644 --- a/package.json +++ b/package.json @@ -14,16 +14,15 @@ "main": "./lib/array.js", "license": "MIT", "scripts": { - "test": "node-gyp rebuild --directory test && mocha -gc --reporter spec" + "test": "node-gyp rebuild --directory test && mocha --expose-gc --reporter spec" }, "dependencies": { - "array-index": "1", - "debug": "2", - "ref": "1" + "array-index": "^1.0.0", + "ref": "npm:@audc/ref@^2.0.0" }, "devDependencies": { - "bindings": "1", - "mocha": "3", - "nan": "2" + "bindings": "^1.5.0", + "mocha": "^11.7.1", + "nan": "^2.22.2" } } diff --git a/test/native_tests.cc b/test/native_tests.cc index 2074d72..2abfe5d 100644 --- a/test/native_tests.cc +++ b/test/native_tests.cc @@ -8,14 +8,13 @@ namespace { NAN_METHOD(ArrayAbs) { int *arr = reinterpret_cast(Buffer::Data(info[0].As())); - uint32_t length = info[1]->Uint32Value(); + uint32_t length = Nan::To(info[1]).FromJust(); for (uint32_t i = 0; i < length; i++) { *(arr + i) = abs(arr[i]); } } -void Initialize(v8::Handle target) { - Nan::HandleScope scope; +NAN_MODULE_INIT(Initialize) { Nan::SetMethod(target, "arrayAbs", ArrayAbs); }