Last active
December 25, 2022 19:44
-
-
Save dlidstrom/a2f787cef41ea4fcb8aa74d459f49270 to your computer and use it in GitHub Desktop.
Revisions
-
dlidstrom revised this gist
Oct 30, 2017 . 1 changed file with 71 additions and 38 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,42 +1,75 @@ includeList = { // put desired module names here }; skipList = {}; handledList = {}; handleModule(window.app); function handleModule(module) { module.requires.forEach(requireName => { if (!includeList[requireName]) { if (!skipList[requireName]) { console.log('Skipping', requireName); } skipList[requireName] = true; return; } if (handledList[requireName]) { return; } handledList[requireName] = true; console.log('cluster_' + requireName.replace(/\./g, '_') + ' {'); console.log('label = "' + requireName + '"'); angular.module(requireName)._invokeQueue.forEach(x => { let depsInfo = x[2]; if (x[1] === 'constant') { outputDependency(depsInfo[0], depsInfo[0] + "Constant", depsInfo[1]); } else if (typeof depsInfo[1] === 'function') { if (!depsInfo[1]) { console.log('hmmm'); } else { if (!depsInfo[1] || !depsInfo[1].$inject) { outputDependency(depsInfo[0], depsInfo[0] + "Factory"); } else { depsInfo[1].$inject.forEach(y => outputDependency(depsInfo[0], y)); } } } else if (_.isArray(depsInfo[1])) { depsInfo[1].forEach(y => { if (typeof y === 'string') { outputDependency(depsInfo[0], y); } }); } else { outputDependency(depsInfo[0], depsInfo[0], depsInfo[1]); } function outputDependency(left, right, value) { if (right.indexOf('$') === 0) return; if (right === '_') return; left = left.replace(/\./g, '_'); right = right.replace(/\./g, '_'); if (value) { console.log(left, "->", right + "Value [label = \"" + right + " " + JSON.stringify(value).replace(/"/g, '\\"') + "\"]"); } else { console.log(left, "->", right); } } }); console.log('}'); handleModule(angular.module(requireName)); }); } -
dlidstrom revised this gist
Oct 25, 2017 . 1 changed file with 17 additions and 8 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,11 +1,19 @@ app._invokeQueue.forEach(x => { let depsInfo = x[2]; if (x[1] === 'constant') { outputDependency(depsInfo[0], depsInfo[0] + "Constant", depsInfo[1]); } else if (typeof depsInfo[1] === 'function') { if (!depsInfo[1]) { console.log('hmmm'); } else { if (!depsInfo[1] || !depsInfo[1].$inject) { outputDependency(depsInfo[0], depsInfo[0] + "Factory"); } else { depsInfo[1].$inject.forEach(y => outputDependency(depsInfo[0], y)); } } } else if (_.isArray(depsInfo[1])) { @@ -22,9 +30,10 @@ app._invokeQueue.forEach(x => { function outputDependency(left, right, value) { if (right.indexOf('$') === 0) return; if (right === '_') return; left = left.replace(/\./g, '_'); right = right.replace(/\./g, '_'); if (value) { console.log(left, "->", right + "Value [label = \"" + right + " " + JSON.stringify(value).replace(/"/g, '\\"') + "\"]"); } else { console.log(left, "->", right); -
dlidstrom created this gist
Oct 25, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,33 @@ app._invokeQueue.forEach(x => { if (x[1] === 'constant') return; let depsInfo = x[2]; if (typeof depsInfo[1] === 'function') { if (!depsInfo[1] || !depsInfo[1].$inject) { outputDependency(depsInfo[0], depsInfo[0] + "Factory"); } else { depsInfo[1].$inject.forEach(y => outputDependency(depsInfo[0], y)); } } else if (_.isArray(depsInfo[1])) { depsInfo[1].forEach(y => { if (typeof y === 'string') { outputDependency(depsInfo[0], y); } }); } else { outputDependency(depsInfo[0], depsInfo[0], depsInfo[1]); } function outputDependency(left, right, value) { if (right.indexOf('$') === 0) return; if (right === '_') return; right = right.replace('.', '_'); if (value) { console.log(left, "->", right + "Value [label = '" + JSON.stringify(value) + "']"); } else { console.log(left, "->", right); } } });