From e1e4ce0740c4939cd5c2bb9ec5b29c3be601b77a Mon Sep 17 00:00:00 2001 From: K35 Date: Mon, 3 Jan 2022 16:12:14 +0000 Subject: [PATCH] Fix verify bug --- lib/jrpc.js | 2 +- package.json | 2 +- src/targets/typescript.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/jrpc.js b/lib/jrpc.js index 7e8f409..0637d60 100755 --- a/lib/jrpc.js +++ b/lib/jrpc.js @@ -7612,7 +7612,7 @@ var TypescriptTarget = class extends CompileTarget { a(2 + off, `if(typeof ${varName} !== "boolean") throw new VerificationError("boolean", "${field.name}", ${varName});`); break; default: - a(2 + off, `if(!verify_${field.type}(${varName})) throw new VerificationError("${field.type}", "${field.name}", ${varName});`); + a(2 + off, `verify_${field.type}(${varName});`); } }; if (field.array) { diff --git a/package.json b/package.json index 829e72f..ef6faf8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@hibas123/jrpcgen", - "version": "1.0.9", + "version": "1.0.10", "main": "lib/index.js", "license": "MIT", "packageManager": "yarn@3.1.1", diff --git a/src/targets/typescript.ts b/src/targets/typescript.ts index 2a7c106..0eca706 100644 --- a/src/targets/typescript.ts +++ b/src/targets/typescript.ts @@ -183,7 +183,7 @@ export class TypescriptTarget extends CompileTarget { default: a( 2 + off, - `if(!verify_${field.type}(${varName})) throw new VerificationError("${field.type}", "${field.name}", ${varName});` + `verify_${field.type}(${varName});` ); } };