1
0
mirror of https://github.com/JuanCanham/HackMyResume.git synced 2025-05-04 05:17:08 +01:00

Fix JSHint warnings.

This commit is contained in:
devlinjd
2015-12-09 21:44:35 -05:00
parent 91aba39050
commit 541198321e
10 changed files with 42 additions and 39 deletions

View File

@ -34,8 +34,8 @@ FluentDate/*.prototype*/.fmt = function( dt ) {
else if( /^\D+\s+\d{4}$/.test(dt) ) { // "Mar 2015"
var parts = dt.split(' ');
var month = (months[parts[0]] || abbr[parts[0]]);
var dt = parts[1] + '-' + (month < 10 ? '0' + month : month.toString());
return moment( dt, 'YYYY-MM' );
var temp = parts[1] + '-' + (month < 10 ? '0' + month : month.toString());
return moment( temp, 'YYYY-MM' );
}
else if( /^\d{4}-\d{1,2}$/.test(dt) ) { // "2015-03", "1998-4"
return moment( dt, 'YYYY-MM' );

View File

@ -55,7 +55,7 @@ Definition of the FRESHResume class.
FS.writeFileSync( this.imp.fileName, FreshResume.stringify( newRep ), 'utf8' );
}
return this;
}
};
FreshResume.prototype.dupe = function() {
var rnew = new FreshResume();
@ -75,7 +75,7 @@ Definition of the FRESHResume class.
) ? undefined : value;
}
return JSON.stringify( obj, replacer, 2 );
},
};
/**
Create a copy of this resume in which all fields have been interpreted as
@ -87,7 +87,7 @@ Definition of the FRESHResume class.
var ret = this.dupe();
function MDIN(txt){
return MD(txt || '' ).replace(/^\s*\<p\>|\<\/p\>\s*$/gi, '');
return MD(txt || '' ).replace(/^\s*<p>|<\/p>\s*$/gi, '');
}
// TODO: refactor recursion
@ -120,6 +120,7 @@ Definition of the FRESHResume class.
markdownifyStringsInObject( sub );
});
}
}
Object.keys( ret ).forEach(function(member){
@ -188,7 +189,7 @@ Definition of the FRESHResume class.
*/
FreshResume.prototype.updateData = function( str ) {
this.clear( false );
this.parse( str )
this.parse( str );
return this;
};
@ -216,7 +217,7 @@ Definition of the FRESHResume class.
FreshResume.default = function() {
return new FreshResume().open(
PATH.join( __dirname, 'empty-fresh.json'), 'Empty' );
}
};
/**
Add work experience to the sheet.
@ -245,9 +246,9 @@ Definition of the FRESHResume class.
FreshResume.prototype.getProfile = function( socialNetwork ) {
socialNetwork = socialNetwork.trim().toLowerCase();
return this.social && _.find( this.social, function(sn) {
return sn.network.trim().toLowerCase() === socialNetwork
return sn.network.trim().toLowerCase() === socialNetwork;
});
}
};
/**
Return an array of profiles for the specified network, for when the user
@ -256,9 +257,9 @@ Definition of the FRESHResume class.
FreshResume.prototype.getProfiles = function( socialNetwork ) {
socialNetwork = socialNetwork.trim().toLowerCase();
return this.social && _.filter( this.social, function(sn){
return sn.network.trim().toLowerCase() === socialNetwork
return sn.network.trim().toLowerCase() === socialNetwork;
});
}
};
/**
Determine if the sheet includes a specific skill.
@ -277,7 +278,7 @@ Definition of the FRESHResume class.
*/
FreshResume.prototype.isValid = function( info ) {
var schemaObj = require('FRESCA');
var validator = require('is-my-json-valid')
var validator = require('is-my-json-valid');
var validate = validator( schemaObj, { // Note [1]
formats: { date: /^\d{4}(?:-(?:0[0-9]{1}|1[0-2]{1})(?:-[0-9]{2})?)?$/ }
});

View File

@ -94,14 +94,14 @@ Definition of the JRSResume class.
});
}
return flatSkills;
},
};
/**
Update the sheet's raw data. TODO: remove/refactor
*/
JRSResume.prototype.updateData = function( str ) {
this.clear( false );
this.parse( str )
this.parse( str );
return this;
};
@ -127,7 +127,7 @@ Definition of the JRSResume class.
*/
JRSResume.default = function() {
return new JRSResume().open( PATH.join( __dirname, 'empty-jrs.json'), 'Empty' );
}
};
/**
Add work experience to the sheet.
@ -168,7 +168,7 @@ Definition of the JRSResume class.
JRSResume.prototype.isValid = function( ) { // TODO: ↓ fix this path ↓
var schema = FS.readFileSync( PATH.join( __dirname, 'resume.json' ), 'utf8' );
var schemaObj = JSON.parse( schema );
var validator = require('is-my-json-valid')
var validator = require('is-my-json-valid');
var validate = validator( schemaObj );
return validate( this );
};

View File

@ -50,8 +50,8 @@ Abstract theme representation.
}
// Add freebie formats every theme gets
formatsHash[ 'json' ] = { title: 'json', outFormat: 'json', pre: 'json', ext: 'json', path: null, data: null };
formatsHash[ 'yml' ] = { title: 'yaml', outFormat: 'yml', pre: 'yml', ext: 'yml', path: null, data: null };
formatsHash.json = { title: 'json', outFormat: 'json', pre: 'json', ext: 'json', path: null, data: null };
formatsHash.yml = { title: 'yaml', outFormat: 'yml', pre: 'yml', ext: 'yml', path: null, data: null };
// Cache
this.formats = formatsHash;
@ -141,7 +141,7 @@ Abstract theme representation.
.forEach(function( cssf ) {
// For each CSS file, get its corresponding HTML file
var idx = _.findIndex(fmts, function( fmt ) {
return fmt.pre === cssf.pre && fmt.ext === 'html'
return fmt.pre === cssf.pre && fmt.ext === 'html';
});
cssf.action = null;
fmts[ idx ].css = cssf.data;
@ -203,7 +203,7 @@ Abstract theme representation.
// compact-[outputformat].[extension], for ex, compact-pdf.html.
if( !outFmt ) {
var idx = pathInfo.name.lastIndexOf('-');
outFmt = ( idx === -1 ) ? pathInfo.name : pathInfo.name.substr( idx + 1 )
outFmt = ( idx === -1 ) ? pathInfo.name : pathInfo.name.substr( idx + 1 );
}
// We should have a valid output format now.
@ -237,7 +237,7 @@ Abstract theme representation.
.forEach(function( cssf ) {
// For each CSS file, get its corresponding HTML file
var idx = _.findIndex(fmts, function( fmt ) {
return fmt.pre === cssf.pre && fmt.ext === 'html'
return fmt.pre === cssf.pre && fmt.ext === 'html';
});
fmts[ idx ].css = cssf.data;
fmts[ idx ].cssPath = cssf.path;