mirror of
https://github.com/JuanCanham/HackMyResume.git
synced 2024-12-23 05:37:23 +00:00
Minor extensions to Sheet class.
This commit is contained in:
parent
8b57f9ce57
commit
ffa06118a0
13
src/sheet.js
13
src/sheet.js
@ -15,6 +15,9 @@ Abstract character/resume sheet representation.
|
||||
this.fileName = null;
|
||||
}
|
||||
|
||||
/**
|
||||
Open and parse the specified JSON resume sheet.
|
||||
*/
|
||||
Sheet.prototype.open = function( file, title ) {
|
||||
var rep = JSON.parse( FS.readFileSync( file, 'utf8' ) );
|
||||
extend( true, this, rep );
|
||||
@ -24,6 +27,16 @@ Abstract character/resume sheet representation.
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
Determine if the sheet includes a specific social profile (eg, GitHub).
|
||||
*/
|
||||
Sheet.prototype.hasProfile = function( socialNetwork ) {
|
||||
socialNetwork = socialNetwork.trim().toLowerCase();
|
||||
return this.basics.profiles && this.basics.profiles.filter(function(prof) {
|
||||
return prof.network.trim().toLowerCase() === socialNetwork;
|
||||
}).length > 0;
|
||||
}
|
||||
|
||||
module.exports = Sheet;
|
||||
|
||||
}());
|
||||
|
Loading…
Reference in New Issue
Block a user