User:MZMcBride/why.js

function why(module){var rdeps=[];if(mw.loader.getState(module)!=="ready")return null;$.each(mw.loader.moduleRegistry,function(name,m){if(m.state==="ready"&&m.dependencies&&m.dependencies.indexOf(module)!==-1)rdeps.push(name)});return rdeps}