-
-
Save soapie/6407110 to your computer and use it in GitHub Desktop.
Revisions
-
soapie revised this gist
Sep 1, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,6 +10,6 @@ repr = (o, depth=0, max=2) -> if Array.isArray o '[' + [''+repr(e, depth + 1, max) for e in o] + ']' else '{' + [''+k+':'+repr(o[k], depth + 1, max) for k in Object.keys(o)] + '}' when 'undefined' then 'undefined' else o.toString # bool or number -
soapie revised this gist
Sep 1, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,7 +7,7 @@ repr = (o, depth=0, max=2) -> when 'function' then 'function' when 'object' if o is null then 'null' if Array.isArray o '[' + [''+repr(e, depth + 1, max) for e in o] + ']' else '{' + [''+k+':'+repr(o[k], depth + 1, max) for k in _.keys(o)] + '}' -
soapie revised this gist
Sep 1, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,4 +12,4 @@ repr = (o, depth=0, max=2) -> else '{' + [''+k+':'+repr(o[k], depth + 1, max) for k in _.keys(o)] + '}' when 'undefined' then 'undefined' else o.toString # bool or number -
jacob414 revised this gist
Jul 5, 2012 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,7 @@ repr = (o, depth=0, max=2) -> '<..>' else switch typeof o when 'string' then "\"#{o.replace /"/g, '\\"'}\"" when 'function' then 'function' when 'object' if o is null then 'null' @@ -12,4 +12,4 @@ repr = (o, depth=0, max=2) -> else '{' + [''+k+':'+repr(o[k], depth + 1, max) for k in _.keys(o)] + '}' when 'undefined' then 'undefined' else o -
jacob414 revised this gist
Jul 5, 2012 . 1 changed file with 5 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,10 +3,13 @@ repr = (o, depth=0, max=2) -> '<..>' else switch typeof o when 'string' then "\"#{o}\"" when 'function' then 'function' when 'object' if o is null then 'null' if _.isArray o '[' + [''+repr(e, depth + 1, max) for e in o] + ']' else '{' + [''+k+':'+repr(o[k], depth + 1, max) for k in _.keys(o)] + '}' when 'undefined' then 'undefined' else o -
jacob414 created this gist
Dec 9, 2010 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ repr = (o, depth=0, max=2) -> if depth > max '<..>' else switch typeof o when 'object' if o is null then 'null' if _.isArray(o) then o else '{' + [''+k+': '+repr(o[k], depth + 1, max) for k in _.keys(o)] + '}' when 'undefined' then 'undefined' else o