1
0
mirror of https://github.com/JuanCanham/HackMyResume.git synced 2025-05-10 07:47:07 +01:00

Implemented private fields that can be included or excluded with cli switch

This commit is contained in:
Daniele Rapagnani
2016-02-14 19:15:47 +01:00
parent 3cf850ea0e
commit fed59b704e
14 changed files with 57 additions and 22 deletions

View File

@ -53,15 +53,20 @@ class FreshResume extends AbstractResume
###
parseJSON: ( rep, opts ) ->
# Ignore any element with the 'ignore: true' designator.
# Ignore any element with the 'ignore: true' or 'private: true' designator.
that = @
traverse = require 'traverse'
ignoreList = []
privateList = []
scrubbed = traverse( rep ).map ( x ) ->
if !@isLeaf && @node.ignore
if @node.ignore == true || this.node.ignore == 'true'
if !@isLeaf
if @node.ignore == true || @node.ignore == 'true'
ignoreList.push this.node
@remove()
else if (@node.private == true || @node.private == 'true') && !opts?.private
privateList.push @node
@remove()
# Now apply the resume representation onto this object
extend( true, @, scrubbed );

View File

@ -48,15 +48,19 @@ class JRSResume extends AbstractResume
###
parseJSON: ( rep, opts ) ->
opts = opts || { };
# Ignore any element with the 'ignore: true' designator.
# Ignore any element with the 'ignore: true' or 'private: true' designator.
that = this
traverse = require 'traverse'
ignoreList = []
privateList = []
scrubbed = traverse( rep ).map ( x ) ->
if !@isLeaf && @node.ignore
if @node.ignore == true || this.node.ignore == 'true'
ignoreList.push @node
if !@isLeaf
if @node.ignore == true || @node.ignore == 'true'
ignoreList.push this.node
@remove()
else if (@node.private == true || @node.private == 'true') && !opts?.private
privateList.push @node
@remove()
# Extend resume properties onto ourself.