File tree Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change 8
8
type ImageSize ,
9
9
type StickerExtension ,
10
10
} from './utils/constants.js' ;
11
+ import { warn } from './utils/utils.js' ;
11
12
12
13
let deprecationEmittedForEmoji = false ;
13
14
@@ -179,11 +180,7 @@ export class CDN {
179
180
180
181
if ( typeof options === 'string' ) {
181
182
if ( ! deprecationEmittedForEmoji ) {
182
- process . emitWarning (
183
- 'Passing a string for CDN#emoji() is deprecated. Use an object instead.' ,
184
- 'DeprecationWarning' ,
185
- ) ;
186
-
183
+ warn ( 'DeprecationWarning: Passing a string for CDN#emoji() is deprecated. Use an object instead.' ) ;
187
184
deprecationEmittedForEmoji = true ;
188
185
}
189
186
Original file line number Diff line number Diff line change @@ -140,3 +140,16 @@ export async function sleep(ms: number): Promise<void> {
140
140
export function isBufferLike ( value : unknown ) : value is ArrayBuffer | Buffer | Uint8Array | Uint8ClampedArray {
141
141
return value instanceof ArrayBuffer || value instanceof Uint8Array || value instanceof Uint8ClampedArray ;
142
142
}
143
+
144
+ /**
145
+ * Irrespective environment warning.
146
+ *
147
+ * @internal
148
+ */
149
+ export function warn ( message : string ) {
150
+ if ( typeof globalThis . process === 'undefined' ) {
151
+ console . warn ( message ) ;
152
+ } else {
153
+ process . emitWarning ( message ) ;
154
+ }
155
+ }
You can’t perform that action at this time.
0 commit comments