1
0
mirror of https://github.com/JuanCanham/HackMyResume.git synced 2025-04-19 14:20:25 +01:00
HackMyResume/src/inspectors/totals-inspector.js
2016-01-03 05:06:54 -05:00

60 lines
1020 B
JavaScript

/**
Section analysis for HackMyResume.
@license MIT. See LICENSE.md for details.
@module totals-inspector.js
*/
(function() {
var _ = require('underscore');
var FluentDate = require('../core/fluent-date');
/**
Retrieve sectional overview and summary information.
@class totalsInspector
*/
var totalsInspector = module.exports = {
moniker: 'totals-inspector',
/**
Run the Totals Inspector on a resume.
@method run
@return An array of objects containing summary information for each section
on the resume.
*/
run: function( rez ) {
var ret = { };
_.each( rez, function(val, key){
if( _.isArray( val ) && !_.isString(val) ) {
ret[ key ] = val.length;
}
else if( val.history && _.isArray( val.history ) ) {
ret[ key ] = val.history.length;
}
else if( val.sets && _.isArray( val.sets ) ) {
ret[ key ] = val.sets.length;
}
});
return ret;
}
};
}());