mirror of
https://github.com/JuanCanham/HackMyResume.git
synced 2024-11-05 09:56:22 +00:00
39 lines
879 B
JavaScript
39 lines
879 B
JavaScript
(function() {
|
|
/**
|
|
Definition of the JsonGenerator class.
|
|
@module generators/json-generator
|
|
@license MIT. See LICENSE.md for details.
|
|
*/
|
|
var BaseGenerator, FJCV, FS, JsonGenerator, _;
|
|
|
|
BaseGenerator = require('./base-generator');
|
|
|
|
FS = require('fs');
|
|
|
|
_ = require('underscore');
|
|
|
|
FJCV = require('fresh-jrs-converter');
|
|
|
|
/** The JsonGenerator generates a FRESH or JRS resume as an output. */
|
|
module.exports = JsonGenerator = class JsonGenerator extends BaseGenerator {
|
|
constructor() {
|
|
super('json');
|
|
}
|
|
|
|
invoke(rez) {
|
|
var altRez;
|
|
altRez = FJCV['to' + (rez.format() === 'FRESH' ? 'JRS' : 'FRESH')](rez);
|
|
return altRez = FJCV.toSTRING(altRez);
|
|
}
|
|
|
|
//altRez.stringify()
|
|
generate(rez, f) {
|
|
FS.writeFileSync(f, this.invoke(rez), 'utf8');
|
|
}
|
|
|
|
};
|
|
|
|
}).call(this);
|
|
|
|
//# sourceMappingURL=json-generator.js.map
|