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

Improve PEEK behavior.

This commit is contained in:
hacksalot
2016-02-02 17:34:10 -05:00
parent d7c83613df
commit 11dd8952d8
4 changed files with 40 additions and 22 deletions

View File

@ -157,12 +157,20 @@ module.exports = class OutputHandler
when HME.afterPeek
sty = if evt.error then 'red' else ( if evt.target != undefined then 'green' else 'yellow' )
# "Peeking at 'someKey' in 'someFile'."
if evt.requested
L(M2C(this.msgs.beforePeek.msg[0], sty), evt.requested, evt.file)
else
L(M2C(this.msgs.beforePeek.msg[1], sty), evt.file)
# If the key was present, print it
if evt.target != undefined
console.dir( evt.target, { depth: null, colors: true } )
# If the key was not present, but no error occurred, print it
else if !evt.error
L(M2C( this.msgs.afterPeek.msg, 'yellow'), evt.requested, evt.file);
else if evt.error
L( chalk.red( evt.error.inner.inner ));