react-native-bootsplash 7.2.0-beta.0 → 7.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -79,30 +79,39 @@ export const setLoggerMode = (value: LoggerMode) => {
79
79
  loggerMode = value;
80
80
  };
81
81
 
82
+ const warningMessages = new Set<string>();
83
+ const errorMessages = new Set<string>();
84
+
82
85
  export const log = {
86
+ warn: (text: string) => {
87
+ if (loggerMode.type === "cli") {
88
+ console.log(pc.yellow(`⚠️ ${text}`));
89
+ } else {
90
+ const message = `⚠️ [${PACKAGE_NAME}] ${text}`;
91
+
92
+ if (!warningMessages.has(message)) {
93
+ warningMessages.add(message);
94
+ console.log(pc.yellow(message));
95
+ }
96
+ }
97
+ },
83
98
  error: (text: string) => {
84
- console.log(
85
- pc.red(
86
- loggerMode.type === "plugin"
87
- ? `❌ [${PACKAGE_NAME}] ${text}`
88
- : `❌ ${text}`,
89
- ),
90
- );
99
+ if (loggerMode.type === "cli") {
100
+ console.log(pc.red(`❌ ${text}`));
101
+ } else {
102
+ const message = `❌ [${PACKAGE_NAME}] ${text}`;
103
+
104
+ if (!errorMessages.has(message)) {
105
+ errorMessages.add(message);
106
+ console.log(pc.red(message));
107
+ }
108
+ }
91
109
  },
92
110
  title: (emoji: string, text: string) => {
93
111
  if (loggerMode.type === "cli") {
94
112
  console.log(`\n${emoji} ${pc.underline(pc.bold(text))}`);
95
113
  }
96
114
  },
97
- warn: (text: string) => {
98
- console.log(
99
- pc.yellow(
100
- loggerMode.type === "plugin"
101
- ? `⚠️ [${PACKAGE_NAME}] ${text}`
102
- : `⚠️ ${text}`,
103
- ),
104
- );
105
- },
106
115
  write: (filePath: string, dimensions?: { width: number; height: number }) => {
107
116
  if (loggerMode.type === "cli") {
108
117
  console.log(