Skip to content

Commit

Permalink
fix(deps): update debug to 4.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeMcC399 committed Dec 7, 2024
1 parent da3f0f5 commit 3c8476f
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 43 deletions.
95 changes: 57 additions & 38 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48371,6 +48371,7 @@ function useColors() {

// Is webkit? http://stackoverflow.com/a/16459606/376773
// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
// eslint-disable-next-line no-return-assign
return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
// Is firebug? http://stackoverflow.com/a/398120/376773
(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
Expand Down Expand Up @@ -48686,24 +48687,62 @@ function setup(env) {
createDebug.names = [];
createDebug.skips = [];

let i;
const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
const len = split.length;
const split = (typeof namespaces === 'string' ? namespaces : '')
.trim()
.replace(' ', ',')
.split(',')
.filter(Boolean);

for (i = 0; i < len; i++) {
if (!split[i]) {
// ignore empty strings
continue;
for (const ns of split) {
if (ns[0] === '-') {
createDebug.skips.push(ns.slice(1));
} else {
createDebug.names.push(ns);
}
}
}

namespaces = split[i].replace(/\*/g, '.*?');

if (namespaces[0] === '-') {
createDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$'));
/**
* Checks if the given string matches a namespace template, honoring
* asterisks as wildcards.
*
* @param {String} search
* @param {String} template
* @return {Boolean}
*/
function matchesTemplate(search, template) {
let searchIndex = 0;
let templateIndex = 0;
let starIndex = -1;
let matchIndex = 0;

while (searchIndex < search.length) {
if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === '*')) {
// Match character or proceed with wildcard
if (template[templateIndex] === '*') {
starIndex = templateIndex;
matchIndex = searchIndex;
templateIndex++; // Skip the '*'
} else {
searchIndex++;
templateIndex++;
}
} else if (starIndex !== -1) { // eslint-disable-line no-negated-condition
// Backtrack to the last '*' and try to match more characters
templateIndex = starIndex + 1;
matchIndex++;
searchIndex = matchIndex;
} else {
createDebug.names.push(new RegExp('^' + namespaces + '$'));
return false; // No match
}
}

// Handle trailing '*' in template
while (templateIndex < template.length && template[templateIndex] === '*') {
templateIndex++;
}

return templateIndex === template.length;
}

/**
Expand All @@ -48714,8 +48753,8 @@ function setup(env) {
*/
function disable() {
const namespaces = [
...createDebug.names.map(toNamespace),
...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)
...createDebug.names,
...createDebug.skips.map(namespace => '-' + namespace)
].join(',');
createDebug.enable('');
return namespaces;
Expand All @@ -48729,41 +48768,21 @@ function setup(env) {
* @api public
*/
function enabled(name) {
if (name[name.length - 1] === '*') {
return true;
}

let i;
let len;

for (i = 0, len = createDebug.skips.length; i < len; i++) {
if (createDebug.skips[i].test(name)) {
for (const skip of createDebug.skips) {
if (matchesTemplate(name, skip)) {
return false;
}
}

for (i = 0, len = createDebug.names.length; i < len; i++) {
if (createDebug.names[i].test(name)) {
for (const ns of createDebug.names) {
if (matchesTemplate(name, ns)) {
return true;
}
}

return false;
}

/**
* Convert regexp to namespace
*
* @param {RegExp} regxep
* @return {String} namespace
* @api private
*/
function toNamespace(regexp) {
return regexp.toString()
.substring(2, regexp.toString().length - 2)
.replace(/\.\*\?$/, '*');
}

/**
* Coerce `val`.
*
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"@actions/io": "1.1.3",
"@octokit/core": "4.2.0",
"argument-vector": "1.0.2",
"debug": "4.3.7",
"debug": "4.4.0",
"find-yarn-workspace-root": "2.0.0",
"got": "11.8.6",
"hasha": "5.2.2",
Expand Down

0 comments on commit 3c8476f

Please sign in to comment.