ahmetozantekin / console.icon

Use icons your console log messages. It's console.icon()
http://codepen.io/ahmetozantekin/pen/qaVKkV?editors=1112
MIT License
47 stars 4 forks source link

Consider using a Map for the icons instead of looping over the array searching for the match #10

Open JoeFirebaugh opened 1 month ago

JoeFirebaugh commented 1 month ago

First of all, this is a really fun project! I've noticed a couple of issues that if fixed would make it event better.

  1. Put the icon registry inside a Map so you can just look them up by name without having to loop over the entire list. This would be better performing.
  2. Adding a second string of text no longer works. It appears that you're missing an else condition when it doesn't find an icon, where it would just append the text. In other words, you can'd do console.icon('beer', 'Cheers!') any more even though your examples shows it as an option.
ahmetozantekin commented 1 month ago

oh i almost forgot this cute repo and thanks for your notice. you can be a contributor if you want it.

JoeFirebaugh commented 1 month ago

Sure, why not? :) Someone might find some real value in this project. I happened upon it while just researching if icons were even possible.