Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
telenode / lib / telenode.js
for (var f in HTTP) {
typeof HTTP[f] === 'function' && (this.HTTP[f] = HTTP[f].bind(this));
}
for (var member in provider) {
if (typeof provider[member] === 'function') {
if (member === 'HTTP' || member === 'provider') {
throw new Error('API object or function name `' + member + '` is reserved');
}
this[member] = provider[member].bind(this);
}
else {
this[member] = {};
for (var f in provider[member]) {
if (typeof provider[member][f] === 'function') {
this[member][f] = provider[member][f].bind(this);
}
}
}
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.