mirror of
https://github.com/JuanCanham/HackMyResume.git
synced 2025-06-07 21:16:14 +01:00
Generate ANALYZE console output from Handlebars template.
This commit is contained in:
@ -30,25 +30,29 @@ Section analysis for HackMyResume.
|
||||
/**
|
||||
Run the Totals Inspector on a resume.
|
||||
@method run
|
||||
@return An array of objects containing summary information for each section
|
||||
on the resume.
|
||||
@return An object containing summary information for each section on the
|
||||
resume.
|
||||
*/
|
||||
run: function( rez ) {
|
||||
|
||||
var ret = { };
|
||||
var sectionTotals = { };
|
||||
_.each( rez, function(val, key){
|
||||
if( _.isArray( val ) && !_.isString(val) ) {
|
||||
ret[ key ] = val.length;
|
||||
sectionTotals[ key ] = val.length;
|
||||
}
|
||||
else if( val.history && _.isArray( val.history ) ) {
|
||||
ret[ key ] = val.history.length;
|
||||
sectionTotals[ key ] = val.history.length;
|
||||
}
|
||||
else if( val.sets && _.isArray( val.sets ) ) {
|
||||
ret[ key ] = val.sets.length;
|
||||
sectionTotals[ key ] = val.sets.length;
|
||||
}
|
||||
});
|
||||
|
||||
return ret;
|
||||
return {
|
||||
totals: sectionTotals,
|
||||
numSections: Object.keys( sectionTotals ).length
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user