Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support custom decode handler #119

Merged
merged 1 commit into from
May 15, 2019
Merged

Conversation

gxcsoccer
Copy link
Member

@gxcsoccer gxcsoccer commented May 8, 2019

#116

hessian.registerDecodeHandler('java.math.BigDecimal', function (result) {
  return {
    $class: result.$class,
    $: result.$.value,
  };
});

const o = { $class: 'java.math.BigDecimal', $: { value: '100.06' } };
const buf = hessian.encode(o, '1.0');
const output = hessian.decode(buf, '1.0');
assert(output === '100.06');

@codecov
Copy link

codecov bot commented May 8, 2019

Codecov Report

Merging #119 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #119   +/-   ##
=======================================
  Coverage   96.27%   96.27%           
=======================================
  Files          11       11           
  Lines        1129     1129           
  Branches      211      211           
=======================================
  Hits         1087     1087           
  Misses         42       42

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3f0b392...4dbb188. Read the comment docs.

@codecov
Copy link

codecov bot commented May 8, 2019

Codecov Report

Merging #119 into master will increase coverage by 0.06%.
The diff coverage is 96.15%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #119      +/-   ##
==========================================
+ Coverage   96.27%   96.34%   +0.06%     
==========================================
  Files          11       12       +1     
  Lines        1129     1150      +21     
  Branches      211      210       -1     
==========================================
+ Hits         1087     1108      +21     
  Misses         42       42
Impacted Files Coverage Δ
lib/custom_handler.js 100% <100%> (ø)
lib/v1/decoder.js 98.2% <100%> (ø) ⬆️
index.js 100% <100%> (ø) ⬆️
lib/v2/decoder.js 92.9% <80%> (+0.02%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3f0b392...608701a. Read the comment docs.

@gxcsoccer gxcsoccer force-pushed the support-custom-decode-handler branch from 4dbb188 to 608701a Compare May 8, 2019 14:10
@gxcsoccer gxcsoccer changed the title [WIP] feat: support custom decode handler feat: support custom decode handler May 8, 2019
@gxcsoccer gxcsoccer requested a review from fengmk2 May 8, 2019 14:12
@denghongcai
Copy link
Contributor

啥时候 merge

@gxcsoccer gxcsoccer merged commit ee57e93 into master May 15, 2019
@gxcsoccer gxcsoccer deleted the support-custom-decode-handler branch May 15, 2019 08:52
@gxcsoccer
Copy link
Member Author

2.9.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants