Closed
Description
In the following code in src/common.js
, the namespaces
string with multiple space delimiters is incorrectly only split at the occurrence of first space
due to the replace()
function only replacing the first occurrence of space with a comma. This leads to a names
array of only two string elements with the second element possibly being incorrect. The replace()
function should replace spaces with commas globally.
const split = (typeof namespaces === 'string' ? namespaces : '')
.trim()
.replace(' ', ',')
.split(',')
.filter(Boolean);
for (const ns of split) {
if (ns[0] === '-') {
createDebug.skips.push(ns.slice(1));
} else {
createDebug.names.push(ns);
}
}
Metadata
Metadata
Assignees
Labels
No labels