Skip to content

Commit

Permalink
fix: disable bigint type checks
Browse files Browse the repository at this point in the history
  • Loading branch information
janvennemann authored and sgtcoolguy committed Oct 3, 2019
1 parent 262acde commit cbb8165
Showing 1 changed file with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1138,7 +1138,7 @@ function groupArrayElements(ctx, output, value) {
let order = 'padStart';
if (value !== undefined) {
for (let i = 0; i < output.length; i++) {
if (typeof value[i] !== 'number' && typeof value[i] !== 'bigint') {
if (typeof value[i] !== 'number') {
order = 'padEnd';
break;
}
Expand Down Expand Up @@ -1210,9 +1210,11 @@ function formatPrimitive(fn, value, ctx) {
if (typeof value === 'number') {
return formatNumber(fn, value);
}
/*
if (typeof value === 'bigint') {
return formatBigInt(fn, value);
}
*/
if (typeof value === 'boolean') {
return fn(`${value}`, 'boolean');
}
Expand Down Expand Up @@ -1577,8 +1579,10 @@ export function formatWithOptions(inspectOptions, ...args) {
const tempArg = args[++a];
if (typeof tempArg === 'number') {
tempStr = formatNumber(stylizeNoColor, tempArg);
/*
} else if (typeof tempArg === 'bigint') {
tempStr = `${tempArg}n`;
*/
} else {
let constr;
if (typeof tempArg !== 'object'
Expand Down Expand Up @@ -1609,9 +1613,12 @@ export function formatWithOptions(inspectOptions, ...args) {
break;
case 100: // 'd'
const tempNum = args[++a];
/*
if (typeof tempNum === 'bigint') {
tempStr = `${tempNum}n`;
} else if (typeof tempNum === 'symbol') {
} else
*/
if (typeof tempNum === 'symbol') {
tempStr = 'NaN';
} else {
tempStr = formatNumber(stylizeNoColor, Number(tempNum));
Expand All @@ -1632,9 +1639,11 @@ export function formatWithOptions(inspectOptions, ...args) {
}
case 105: // 'i'
const tempInteger = args[++a];
/*
if (typeof tempInteger === 'bigint') {
tempStr = `${tempInteger}n`;
} else if (typeof tempInteger === 'symbol') {
} else */
if (typeof tempInteger === 'symbol') {
tempStr = 'NaN';
} else {
tempStr = formatNumber(stylizeNoColor, parseInt(tempInteger));
Expand Down

0 comments on commit cbb8165

Please sign in to comment.