Skip to content

Commit ea049e5

Browse files
committed
Merge branch 'main' into @chrispader/enable-16kb-memory-page-size-on-android
2 parents 8e375d1 + df8852b commit ea049e5

389 files changed

Lines changed: 7822 additions & 11631 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/actions/javascript/authorChecklist/index.js

Lines changed: 82 additions & 41 deletions
Large diffs are not rendered by default.

.github/actions/javascript/awaitStagingDeploys/index.js

Lines changed: 25 additions & 3 deletions
Large diffs are not rendered by default.

.github/actions/javascript/checkAndroidStatus/index.js

Lines changed: 82 additions & 41 deletions
Large diffs are not rendered by default.

.github/actions/javascript/checkDeployBlockers/index.js

Lines changed: 25 additions & 3 deletions
Large diffs are not rendered by default.

.github/actions/javascript/createOrUpdateStagingDeploy/index.js

Lines changed: 25 additions & 3 deletions
Large diffs are not rendered by default.

.github/actions/javascript/getAndroidRolloutPercentage/index.js

Lines changed: 57 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -5178,6 +5178,7 @@ function useColors() {
51785178

51795179
// Is webkit? http://stackoverflow.com/a/16459606/376773
51805180
// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
5181+
// eslint-disable-next-line no-return-assign
51815182
return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
51825183
// Is firebug? http://stackoverflow.com/a/398120/376773
51835184
(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
@@ -5493,24 +5494,62 @@ function setup(env) {
54935494
createDebug.names = [];
54945495
createDebug.skips = [];
54955496

5496-
let i;
5497-
const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
5498-
const len = split.length;
5497+
const split = (typeof namespaces === 'string' ? namespaces : '')
5498+
.trim()
5499+
.replace(' ', ',')
5500+
.split(',')
5501+
.filter(Boolean);
54995502

5500-
for (i = 0; i < len; i++) {
5501-
if (!split[i]) {
5502-
// ignore empty strings
5503-
continue;
5503+
for (const ns of split) {
5504+
if (ns[0] === '-') {
5505+
createDebug.skips.push(ns.slice(1));
5506+
} else {
5507+
createDebug.names.push(ns);
55045508
}
5509+
}
5510+
}
55055511

5506-
namespaces = split[i].replace(/\*/g, '.*?');
5507-
5508-
if (namespaces[0] === '-') {
5509-
createDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$'));
5512+
/**
5513+
* Checks if the given string matches a namespace template, honoring
5514+
* asterisks as wildcards.
5515+
*
5516+
* @param {String} search
5517+
* @param {String} template
5518+
* @return {Boolean}
5519+
*/
5520+
function matchesTemplate(search, template) {
5521+
let searchIndex = 0;
5522+
let templateIndex = 0;
5523+
let starIndex = -1;
5524+
let matchIndex = 0;
5525+
5526+
while (searchIndex < search.length) {
5527+
if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === '*')) {
5528+
// Match character or proceed with wildcard
5529+
if (template[templateIndex] === '*') {
5530+
starIndex = templateIndex;
5531+
matchIndex = searchIndex;
5532+
templateIndex++; // Skip the '*'
5533+
} else {
5534+
searchIndex++;
5535+
templateIndex++;
5536+
}
5537+
} else if (starIndex !== -1) { // eslint-disable-line no-negated-condition
5538+
// Backtrack to the last '*' and try to match more characters
5539+
templateIndex = starIndex + 1;
5540+
matchIndex++;
5541+
searchIndex = matchIndex;
55105542
} else {
5511-
createDebug.names.push(new RegExp('^' + namespaces + '$'));
5543+
return false; // No match
55125544
}
55135545
}
5546+
5547+
// Handle trailing '*' in template
5548+
while (templateIndex < template.length && template[templateIndex] === '*') {
5549+
templateIndex++;
5550+
}
5551+
5552+
return templateIndex === template.length;
55145553
}
55155554

55165555
/**
@@ -5521,8 +5560,8 @@ function setup(env) {
55215560
*/
55225561
function disable() {
55235562
const namespaces = [
5524-
...createDebug.names.map(toNamespace),
5525-
...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)
5563+
...createDebug.names,
5564+
...createDebug.skips.map(namespace => '-' + namespace)
55265565
].join(',');
55275566
createDebug.enable('');
55285567
return namespaces;
@@ -5536,41 +5575,21 @@ function setup(env) {
55365575
* @api public
55375576
*/
55385577
function enabled(name) {
5539-
if (name[name.length - 1] === '*') {
5540-
return true;
5541-
}
5542-
5543-
let i;
5544-
let len;
5545-
5546-
for (i = 0, len = createDebug.skips.length; i < len; i++) {
5547-
if (createDebug.skips[i].test(name)) {
5578+
for (const skip of createDebug.skips) {
5579+
if (matchesTemplate(name, skip)) {
55485580
return false;
55495581
}
55505582
}
55515583

5552-
for (i = 0, len = createDebug.names.length; i < len; i++) {
5553-
if (createDebug.names[i].test(name)) {
5584+
for (const ns of createDebug.names) {
5585+
if (matchesTemplate(name, ns)) {
55545586
return true;
55555587
}
55565588
}
55575589

55585590
return false;
55595591
}
55605592

5561-
/**
5562-
* Convert regexp to namespace
5563-
*
5564-
* @param {RegExp} regxep
5565-
* @return {String} namespace
5566-
* @api private
5567-
*/
5568-
function toNamespace(regexp) {
5569-
return regexp.toString()
5570-
.substring(2, regexp.toString().length - 2)
5571-
.replace(/\.\*\?$/, '*');
5572-
}
5573-
55745593
/**
55755594
* Coerce `val`.
55765595
*

.github/actions/javascript/getArtifactInfo/index.js

Lines changed: 25 additions & 3 deletions
Large diffs are not rendered by default.

.github/actions/javascript/getDeployPullRequestList/index.js

Lines changed: 25 additions & 3 deletions
Large diffs are not rendered by default.

.github/actions/javascript/getPullRequestDetails/index.js

Lines changed: 25 additions & 3 deletions
Large diffs are not rendered by default.

.github/actions/javascript/isStagingDeployLocked/index.js

Lines changed: 25 additions & 3 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)