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

Unable to use RpcStatusType enum #13

Closed
makoven opened this issue Oct 1, 2019 · 3 comments
Closed

Unable to use RpcStatusType enum #13

makoven opened this issue Oct 1, 2019 · 3 comments

Comments

@makoven
Copy link

makoven commented Oct 1, 2019

RpcStatusType is defined in jsonrpc.ts, but not in jsonrpc.js. So this code throws an error:

import { RpcStatusType } from "jsonrpc-lite";
...
switch (req.type) {
  case RpcStatusType.invalid:
...
@antongolub
Copy link
Contributor

antongolub commented Oct 17, 2019

Moreover, if we'd try to use this enum with ts-jest it will also be undefined. (kulshekhar/ts-jest#281).

I guess, we should make enum const:

export const enum RpcStatusType {
  request = 'request',
  notification = 'notification',
  success = 'success',
  error = 'error',
  invalid = 'invalid',
}

@antongolub
Copy link
Contributor

@junyuanqi, @zensh could anybody review the fix?

@zensh zensh closed this as completed in bd71f17 Oct 21, 2019
@zensh
Copy link
Collaborator

zensh commented Oct 21, 2019

@antongolub Thank you very much, v2.1.0 released.

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

No branches or pull requests

3 participants