mirror of
https://github.com/Instadapp/Swap-Aggregator-Subgraph.git
synced 2024-07-29 21:57:12 +00:00
24 lines
598 B
JavaScript
24 lines
598 B
JavaScript
'use strict';
|
|
|
|
const Method = require('./method');
|
|
const jayson = require('../../');
|
|
|
|
/**
|
|
* Constructor for a Jayson Promise Server
|
|
* @see Server
|
|
* @class PromiseServer
|
|
* @extends Server
|
|
* @return {PromiseServer}
|
|
*/
|
|
const PromiseServer = function(methods, options) {
|
|
if(!(this instanceof PromiseServer)) {
|
|
return new PromiseServer(methods, options);
|
|
}
|
|
options = options || {};
|
|
options.methodConstructor = options.methodConstructor || Method;
|
|
jayson.Server.call(this, methods, options);
|
|
};
|
|
require('util').inherits(PromiseServer, jayson.Server);
|
|
|
|
module.exports = PromiseServer;
|