File tree 3 files changed +24
-0
lines changed
3 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,16 @@ exports.save = save;
9
9
exports . load = load ;
10
10
exports . useColors = useColors ;
11
11
exports . storage = localstorage ( ) ;
12
+ exports . destroy = ( ( ) => {
13
+ let warned = false ;
14
+
15
+ return ( ) => {
16
+ if ( ! warned ) {
17
+ warned = true ;
18
+ console . warn ( 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.' ) ;
19
+ }
20
+ } ;
21
+ } ) ( ) ;
12
22
13
23
/**
14
24
* Colors.
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ function setup(env) {
12
12
createDebug . enable = enable ;
13
13
createDebug . enabled = enabled ;
14
14
createDebug . humanize = require ( 'ms' ) ;
15
+ createDebug . destroy = destroy ;
15
16
16
17
Object . keys ( env ) . forEach ( key => {
17
18
createDebug [ key ] = env [ key ] ;
@@ -114,6 +115,7 @@ function setup(env) {
114
115
debug . useColors = createDebug . useColors ( ) ;
115
116
debug . color = createDebug . selectColor ( namespace ) ;
116
117
debug . extend = extend ;
118
+ debug . destroy = createDebug . destroy ; // XXX Temporary. Will be removed in the next major release.
117
119
118
120
Object . defineProperty ( debug , 'enabled' , {
119
121
enumerable : true ,
@@ -243,6 +245,14 @@ function setup(env) {
243
245
return val ;
244
246
}
245
247
248
+ /**
249
+ * XXX DO NOT USE. This is a temporary stub function.
250
+ * XXX It WILL be removed in the next major release.
251
+ */
252
+ function destroy ( ) {
253
+ console . warn ( 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.' ) ;
254
+ }
255
+
246
256
createDebug . enable ( createDebug . load ( ) ) ;
247
257
248
258
return createDebug ;
Original file line number Diff line number Diff line change @@ -15,6 +15,10 @@ exports.formatArgs = formatArgs;
15
15
exports . save = save ;
16
16
exports . load = load ;
17
17
exports . useColors = useColors ;
18
+ exports . destroy = util . deprecate (
19
+ ( ) => { } ,
20
+ 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'
21
+ ) ;
18
22
19
23
/**
20
24
* Colors.
You can’t perform that action at this time.
0 commit comments