Git Product home page Git Product logo

jsonrpc-serializer's People

Contributors

derfel avatar jiangyouxin avatar matiassingers avatar soggie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

jsonrpc-serializer's Issues

declare strict mode for older node versions

i just updated to version 0.2.0, but im getting an error when running. I think its because im using an older version of node: 4.6.2, but none the less i think you use need to use strict mode to fix this.

/home/developer/src/json-rpc-core/node_modules/jsonrpc-serializer/lib/serializer.js:415
    let obj = null
    ^^^
SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode

need a way to add additional data to errors

You are adding additional data parameters to the error object with this call

JsonRpcError = function JsonRpcError(msg) {
    this.name    = 'JsonRpcError';
    this.code    = -32603;
    this.message = msg;
    this.data    = Array.prototype.slice.call(arguments).splice();
};

The problem is that this.data always ends up with an empty array since calling splice with no arguments always returns []. I'm not sure what you intended to do with the data parameter, but it would be nice if this could be fixed so that we can add additional data to the error such as the stack dump, etc.

im currently using your library as a dependency in json-rpc-core. thanks!

Add a serialize() helper method to streamline the API

From #2 , there's a need for the API to cater to returning objects from serialization methods

The new API that I will be implementing in 0.2.0 is:

// current
jrs.requestObject('id', 'method'); // ---> object
jrs.request('id', 'method'); // ---> string

// proposed
jrs.request('id', 'method'); // ---> object
jrs.request('id', 'method').serialize(); // ---> string

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.