Skip to content

Instantly share code, notes, and snippets.

@jussi-kalliokoski
Created August 8, 2013 07:29
Show Gist options
  • Save jussi-kalliokoski/6182349 to your computer and use it in GitHub Desktop.
Save jussi-kalliokoski/6182349 to your computer and use it in GitHub Desktop.
Detect which lodash/underscore functions your code is using.
var usedFunctions = function (_) {
"use strict";
var usedFunctions = [];
var isFunction = _.isFunction;
var contains = _.contains;
_.forOwn(_, function (func, name) {
if ( !isFunction(func) ) { return; }
_[name] = function () {
usedFunctions.push(name);
_[name] = func;
return func.apply(_, arguments);
};
});
return usedFunctions;
}(window._);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment