tigerbeetle-node 0.12.56 → 0.12.57

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.
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tigerbeetle-node",
3
- "version": "0.12.56",
3
+ "version": "0.12.57",
4
4
  "description": "TigerBeetle Node.js client",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
package/src/node.zig CHANGED
@@ -579,7 +579,7 @@ fn request(env: c.napi_env, info: c.napi_callback_info) callconv(.C) c.napi_valu
579
579
  const context = contextCast(context_raw.?) catch return null;
580
580
  const operation_int = translate.u32_from_value(env, argv[1], "operation") catch return null;
581
581
 
582
- if (operation_int >= @typeInfo(Operation).Enum.fields.len) {
582
+ if (!@intToEnum(vsr.Operation, operation_int).valid(StateMachine)) {
583
583
  translate.throw(env, "Unknown operation.") catch return null;
584
584
  }
585
585
 
@@ -628,7 +628,7 @@ fn raw_request(env: c.napi_env, info: c.napi_callback_info) callconv(.C) c.napi_
628
628
  const context = contextCast(context_raw.?) catch return null;
629
629
  const operation_int = translate.u32_from_value(env, argv[1], "operation") catch return null;
630
630
 
631
- if (operation_int >= @typeInfo(Operation).Enum.fields.len) {
631
+ if (!@intToEnum(vsr.Operation, operation_int).valid(StateMachine)) {
632
632
  translate.throw(env, "Unknown operation.") catch return null;
633
633
  }
634
634
  const operation = @intToEnum(Operation, @intCast(u8, operation_int));