GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — console: use spread notation instead of Object.assign · nodejs/node@561c268

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib/internal/console
    • constructor.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/internal/console/constructor.js‎

Copy file name to clipboardExpand all lines: lib/internal/console/constructor.js
+9-5Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -411,11 +411,15 @@ Console.prototype.table = function(tabularData, properties) {
411411
const final = (k, v) => this.log(cliTable(k, v));
412412

413413
const inspect = (v) => {
414-
const opt = { depth: 0, maxArrayLength: 3 };
415-
if (v !== null && typeof v === 'object' &&
416-
!isArray(v) && ObjectKeys(v).length > 2)
417-
opt.depth = -1;
418-
Object.assign(opt, this[kGetInspectOptions](this._stdout));
414+
const depth = v !== null &&
415+
typeof v === 'object' &&
416+
!isArray(v) &&
417+
ObjectKeys(v).length > 2 ? -1 : 0;
418+
const opt = {
419+
depth,
420+
maxArrayLength: 3,
421+
...this[kGetInspectOptions](this._stdout)
422+
};
419423
return util.inspect(v, opt);
420424
};
421425
const getIndexArray = (length) => ArrayFrom({ length }, (_, i) => inspect(i));

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.