@xh/hoist 76.0.0-SNAPSHOT.1758147719816 → 76.0.0-SNAPSHOT.1758150416326
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.
package/utils/js/LangUtils.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import {PlainObject, Thunkable} from '@xh/hoist/core';
|
|
8
8
|
import {Exception} from '@xh/hoist/core/exception/Exception';
|
|
9
|
-
import {type LogSource
|
|
9
|
+
import {type LogSource} from '@xh/hoist/utils/log';
|
|
10
10
|
import {
|
|
11
11
|
flatMap,
|
|
12
12
|
forOwn,
|
|
@@ -131,7 +131,7 @@ export function throwIf(condition: any, message: unknown) {
|
|
|
131
131
|
*/
|
|
132
132
|
export function warnIf(condition: any, message: any) {
|
|
133
133
|
if (condition) {
|
|
134
|
-
|
|
134
|
+
console.warn(message);
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
137
|
|
|
@@ -140,7 +140,7 @@ export function warnIf(condition: any, message: any) {
|
|
|
140
140
|
*/
|
|
141
141
|
export function errorIf(condition: any, message: any) {
|
|
142
142
|
if (condition) {
|
|
143
|
-
|
|
143
|
+
console.error(message);
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
146
|
|
|
@@ -170,7 +170,7 @@ export interface APIWarnOptions {
|
|
|
170
170
|
/** An additional message. Can contain suggestions for alternatives. */
|
|
171
171
|
msg?: string;
|
|
172
172
|
|
|
173
|
-
/** Source of message for
|
|
173
|
+
/** Source of message for labeling log message. */
|
|
174
174
|
source?: LogSource;
|
|
175
175
|
}
|
|
176
176
|
|
|
@@ -198,7 +198,7 @@ export function apiDeprecated(name: string, opts: APIWarnOptions = {}) {
|
|
|
198
198
|
msg = opts.msg ?? '',
|
|
199
199
|
warn = `The use of '${name}' has been deprecated and will be removed in ${v}. ${msg}`;
|
|
200
200
|
if (!_seenWarnings[warn]) {
|
|
201
|
-
|
|
201
|
+
console.warn(warn, opts.source);
|
|
202
202
|
_seenWarnings[warn] = true;
|
|
203
203
|
}
|
|
204
204
|
}
|