1
0
mirror of https://github.com/JuanCanham/HackMyResume.git synced 2025-07-11 12:41:06 +01:00

Misc improvements.

This commit is contained in:
hacksalot
2016-01-12 18:13:54 -05:00
parent 1966b0a862
commit 1b94ada709
4 changed files with 64 additions and 28 deletions

View File

@ -31,6 +31,18 @@ Definition of the ResumeFactory class.
/**
Load one or more resumes from disk.
@param opts An options object with settings for the factory as well as
passthrough settings for FRESHResume or JRSResume. Structure:
{
format: 'FRESH', // Format to open as. ('FRESH', 'JRS', null)
objectify: true, // FRESH/JRSResume or raw JSON?
inner: { // Passthru options for FRESH/JRSResume
sort: false
}
}
*/
load: function ( sources, opts, emitter ) {
@ -47,7 +59,7 @@ Definition of the ResumeFactory class.
*/
loadOne: function( src, opts, emitter ) {
var toFormat = opts.format;
var toFormat = opts.format; // Can be null
var objectify = opts.objectify;
// Get the destination format. Can be 'fresh', 'jrs', or null/undefined.
@ -73,7 +85,7 @@ Definition of the ResumeFactory class.
var rez;
if( objectify ) {
var ResumeClass = require('../core/' + (toFormat || orgFormat) + '-resume');
rez = new ResumeClass().parseJSON( json );
rez = new ResumeClass().parseJSON( json, opts.inner );
rez.i().file = src;
}