Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
], function (superModule, wrapper) {
// Let's wrap it, aspect style
wrapper(superModule, 'superModule');
// Tada, all superModule methods will now log
], function (_) {
return function (toWrap, identifier) {
.each(function (method) {
var oldMethod = toWrap[method];
toWrap[method] = function () {
var groupName = identifier + ': ' + method;;
console.log('%s args: %o', method, arguments);
var value = oldMethod.apply(this, arguments);
console.log('%s return value: %o', method, value);
return value;
return toWrap;
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.