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;
99exports . load = load ;
1010exports . useColors = useColors ;
1111exports . 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+ } ) ( ) ;
1222
1323/**
1424 * Colors.
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ function setup(env) {
1212 createDebug . enable = enable ;
1313 createDebug . enabled = enabled ;
1414 createDebug . humanize = require ( 'ms' ) ;
15+ createDebug . destroy = destroy ;
1516
1617 Object . keys ( env ) . forEach ( key => {
1718 createDebug [ key ] = env [ key ] ;
@@ -114,6 +115,7 @@ function setup(env) {
114115 debug . useColors = createDebug . useColors ( ) ;
115116 debug . color = createDebug . selectColor ( namespace ) ;
116117 debug . extend = extend ;
118+ debug . destroy = createDebug . destroy ; // XXX Temporary. Will be removed in the next major release.
117119
118120 Object . defineProperty ( debug , 'enabled' , {
119121 enumerable : true ,
@@ -243,6 +245,14 @@ function setup(env) {
243245 return val ;
244246 }
245247
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+
246256 createDebug . enable ( createDebug . load ( ) ) ;
247257
248258 return createDebug ;
Original file line number Diff line number Diff line change @@ -15,6 +15,10 @@ exports.formatArgs = formatArgs;
1515exports . save = save ;
1616exports . load = load ;
1717exports . 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+ ) ;
1822
1923/**
2024 * Colors.
You can’t perform that action at this time.
0 commit comments