We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 66e3b12 commit f1d5461Copy full SHA for f1d5461
4 files changed
src/config/index.js
src/emoji.js
@@ -0,0 +1,13 @@
1
+import logLevels from './config/log-levels';
2
+
3
+export default class Emoji {
4
+ static setEmoji(type, emoji) {
5
+ const foundByType = logLevels.get(type);
6
+ foundByType.emoji = emoji;
7
+ return emoji;
8
+ };
9
10
+ static getEmoji(type) {
11
+ return logLevels.get(type).emoji;
12
+ }
13
+}
tests/config.test.js
tests/emoji.test.js
@@ -0,0 +1,11 @@
+import { Emoji } from '../src';
+describe('Emoji', () => {
+ test('should set emoji by type', () => {
+ expect(Emoji.setEmoji('info', '🦁')).toEqual('🦁');
+ });
+ test('should get emoji by type', () => {
+ expect(Emoji.getEmoji('error')).toEqual('🚫');
+});
0 commit comments