File tree Expand file tree Collapse file tree 3 files changed +24
-0
lines changed Expand file tree Collapse file tree 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 = selectColor ( namespace ) ;
116
117
debug . extend = extend ;
118
+ debug . destroy = createDebug . destroy ; // XXX Temporary. Will be removed in the next major release.
117
119
// Debug.formatArgs = formatArgs;
118
120
// debug.rawLog = rawLog;
119
121
@@ -245,6 +247,14 @@ function setup(env) {
245
247
return val ;
246
248
}
247
249
250
+ /**
251
+ * XXX DO NOT USE. This is a temporary stub function.
252
+ * XXX It WILL be removed in the next major release.
253
+ */
254
+ function destroy ( ) {
255
+ console . warn ( 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.' ) ;
256
+ }
257
+
248
258
createDebug . enable ( createDebug . load ( ) ) ;
249
259
250
260
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