mirror of
https://github.com/zebrajr/react.git
synced 2025-12-06 12:20:20 +01:00
[Flight] Remove superfluous whitespace when console method is called with non-strings (#33953)
This commit is contained in:
parent
7513996f20
commit
f6fb1a07a5
|
|
@ -49,7 +49,7 @@ export function bindToConsole(
|
|||
newArgs.splice(
|
||||
offset,
|
||||
1,
|
||||
badgeFormat + newArgs[offset],
|
||||
badgeFormat + ' ' + newArgs[offset],
|
||||
badgeStyle,
|
||||
pad + badgeName + pad,
|
||||
resetStyle,
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ export function bindToConsole(
|
|||
newArgs.splice(
|
||||
offset,
|
||||
1,
|
||||
badgeFormat + newArgs[offset],
|
||||
badgeFormat + ' ' + newArgs[offset],
|
||||
pad + badgeName + pad,
|
||||
);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ export function bindToConsole(
|
|||
newArgs.splice(
|
||||
offset,
|
||||
1,
|
||||
badgeFormat + newArgs[offset],
|
||||
badgeFormat + ' ' + newArgs[offset],
|
||||
badgeStyle,
|
||||
pad + badgeName + pad,
|
||||
resetStyle,
|
||||
|
|
|
|||
|
|
@ -54,7 +54,12 @@ export function unbadgeConsole(
|
|||
typeof badge === 'string'
|
||||
) {
|
||||
// Remove our badging from the arguments.
|
||||
args.splice(offset, 4, format.slice(badgeFormat.length));
|
||||
let unbadgedFormat = format.slice(badgeFormat.length);
|
||||
if (unbadgedFormat[0] === ' ') {
|
||||
// Spacing added on the Client if the original argument was a string.
|
||||
unbadgedFormat = unbadgedFormat.slice(1);
|
||||
}
|
||||
args.splice(offset, 4, unbadgedFormat);
|
||||
return badge.slice(padLength, badge.length - padLength);
|
||||
}
|
||||
return null;
|
||||
|
|
|
|||
|
|
@ -45,7 +45,12 @@ export function unbadgeConsole(
|
|||
badge.endsWith(pad)
|
||||
) {
|
||||
// Remove our badging from the arguments.
|
||||
args.splice(offset, 2, format.slice(badgeFormat.length));
|
||||
let unbadgedFormat = format.slice(badgeFormat.length);
|
||||
if (unbadgedFormat[0] === ' ') {
|
||||
// Spacing added on the Client if the original argument was a string.
|
||||
unbadgedFormat = unbadgedFormat.slice(1);
|
||||
}
|
||||
args.splice(offset, 4, unbadgedFormat);
|
||||
return badge.slice(padLength, badge.length - padLength);
|
||||
}
|
||||
return null;
|
||||
|
|
|
|||
|
|
@ -53,7 +53,12 @@ export function unbadgeConsole(
|
|||
typeof badge === 'string'
|
||||
) {
|
||||
// Remove our badging from the arguments.
|
||||
args.splice(offset, 4, format.slice(badgeFormat.length));
|
||||
let unbadgedFormat = format.slice(badgeFormat.length);
|
||||
if (unbadgedFormat[0] === ' ') {
|
||||
// Spacing added on the Client if the original argument was a string.
|
||||
unbadgedFormat = unbadgedFormat.slice(1);
|
||||
}
|
||||
args.splice(offset, 4, unbadgedFormat);
|
||||
return badge.slice(padLength, badge.length - padLength);
|
||||
}
|
||||
return null;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user