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:
@ -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 );
|
||||
|
@ -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.
|
||||
|
Reference in New Issue
Block a user