mirror of
https://github.com/debug-js/debug.git
synced 2025-12-08 20:59:48 +00:00
debug: ignore empty strings in enable()
Stops the unnecessary /^$/ regexp from being "enabled".
This commit is contained in:
parent
48114629b4
commit
4ddbb61abd
1
debug.js
1
debug.js
@ -121,6 +121,7 @@ function enable(namespaces) {
|
||||
var len = split.length;
|
||||
|
||||
for (var i = 0; i < len; i++) {
|
||||
if (!split[i]) continue; // ignore empty strings
|
||||
namespaces = split[i].replace('*', '.*?');
|
||||
if (namespaces[0] === '-') {
|
||||
exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user