| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent acfb724 commit 3dc3a31
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -625,6 +625,8 @@ function formatValue(ctx, value, recurseTimes) { | |||
| 625 | 625 | formatter = formatMap; | |
| 626 | 626 | } else if (isTypedArray(value)) { | |
| 627 | 627 | braces = [`${getPrefix(constructor, tag)}[`, ']']; | |
| 628 | + if (value.length === 0 && keyLength === 0 && !ctx.showHidden) | ||
| 629 | + return `${braces[0]}]`; | ||
| 628 | 630 | formatter = formatTypedArray; | |
| 629 | 631 | } else if (isMapIterator(value)) { | |
| 630 | 632 | braces = [`[${tag}] {`, '}']; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -79,7 +79,8 @@ assert.strictEqual(util.inspect({ 'a': { 'b': { 'c': 2 } } }, false, 1), | |||
| 79 | 79 | '{ a: { b: [Object] } }'); | |
| 80 | 80 | assert.strictEqual(util.inspect({ 'a': { 'b': ['c'] } }, false, 1), | |
| 81 | 81 | '{ a: { b: [Array] } }'); | |
| 82 | - assert.strictEqual(util.inspect(new Uint8Array(0)), 'Uint8Array [ ]'); | ||
| 82 | + assert.strictEqual(util.inspect(new Uint8Array(0)), 'Uint8Array []'); | ||
| 83 | + assert(inspect(new Uint8Array(0), { showHidden: true }).includes('[buffer]')); | ||
| 83 | 84 | assert.strictEqual( | |
| 84 | 85 | util.inspect( | |
| 85 | 86 | Object.create( | |
| Back | FazBrowse Home | New Git URL |
0 commit comments