mirror of https://github.com/BTCPrivate/copay.git
add getArgTypes command
Which allows you to see what arguments you need to pass to a function.
This commit is contained in:
parent
cba3487988
commit
4773b6577a
18
bin/Copay.js
18
bin/Copay.js
|
@ -84,6 +84,24 @@ Copay.prototype.getBalance.argTypes =
|
|||
];
|
||||
*/
|
||||
|
||||
Copay.prototype.getArgTypes = function getArgTypes(command, callback) {
|
||||
var self = this;
|
||||
checkArgs(arguments.callee.name, arguments);
|
||||
|
||||
if (command[0] == '_' || typeof Copay.prototype[command] != 'function')
|
||||
return callback(new Error('Invalid command'));
|
||||
|
||||
var argTypes = Copay.prototype[command].argTypes;
|
||||
|
||||
return callback(null, argTypes);
|
||||
};
|
||||
|
||||
Copay.prototype.getArgTypes.argTypes =
|
||||
[
|
||||
['command', 'string'],
|
||||
['callback', 'function']
|
||||
];
|
||||
|
||||
Copay.prototype.getCommands = function getCommands(callback) {
|
||||
var self = this;
|
||||
checkArgs(arguments.callee.name, arguments);
|
||||
|
|
Loading…
Reference in New Issue