You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The basic idea is to add an ability that lets you give specific colors to specific keys for any JSON object that you happen to colorize. For example you can do something like
console.log(colorize({"uri": "localhost:3000","status":404},{colors: {JSON_OBJECT_CUSTOM: function(key,value,currentJsonObject){if(key==='status'&¤tJsonObject.hasOwnProperty('uri')){if(value.toString.startsWith('2')){return'green';}elseif(value.toString.startsWith('3'){return'orange';}elseif(value.toString.startsWith('4'){return'red';}elseif(value.toString.startsWith('5'){return'red';}returnnull;// If we return null then we just use original color.}};}}));
Would you be open to such functionality or is this considered scope creep?
The text was updated successfully, but these errors were encountered:
mdedetrich
changed the title
Allowing giving specific colors to certain JSON object keys
Allowing giving specific colors to certain JSON object keys/values
Jun 23, 2020
The basic idea is to add an ability that lets you give specific colors to specific keys for any JSON object that you happen to colorize. For example you can do something like
Would you be open to such functionality or is this considered scope creep?
The text was updated successfully, but these errors were encountered: