From 40c9467d8f6cc0e0485225832874ca50e9d39f03 Mon Sep 17 00:00:00 2001 From: killa Date: Wed, 21 Nov 2018 17:16:46 +0800 Subject: [PATCH] fix: fix byte array class name (#6) --- lib/utils.js | 1 + test/utils.test.js | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/lib/utils.js b/lib/utils.js index 8e42c2c..3760f8a 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -69,6 +69,7 @@ const arrayTypeMap = { double: 'D', long: 'J', float: 'F', + byte: 'B', string: 'Ljava.lang.String;', object: 'Ljava.lang.Object;', }; diff --git a/test/utils.test.js b/test/utils.test.js index 2f30872..ca97c23 100644 --- a/test/utils.test.js +++ b/test/utils.test.js @@ -119,6 +119,11 @@ describe('test/utils.test.js', () => { isArray: true, arrayDepth: 2, }) === '[[Ljava.lang.String;'); + assert(utils.getJavaClassname({ + $class: 'byte', + $: Buffer.from('A'), + isArray: true, + }) === '[B'); }); it('should flatCopyTo ok', () => {