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 — util: convert inspect.styles and inspect.colors to prototype-less obj… · nodejs/node@aab0d20

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib
    • util.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/util.js‎

Copy file name to clipboardExpand all lines: lib/util.js
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ Object.defineProperty(inspect, 'defaultOptions', {
166166
});
167167

168168
// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
169-
inspect.colors = {
169+
inspect.colors = Object.assign(Object.create(null), {
170170
'bold': [1, 22],
171171
'italic': [3, 23],
172172
'underline': [4, 24],
@@ -180,10 +180,10 @@ inspect.colors = {
180180
'magenta': [35, 39],
181181
'red': [31, 39],
182182
'yellow': [33, 39]
183-
};
183+
});
184184

185185
// Don't use 'blue' not visible on cmd.exe
186-
inspect.styles = {
186+
inspect.styles = Object.assign(Object.create(null), {
187187
'special': 'cyan',
188188
'number': 'yellow',
189189
'boolean': 'yellow',
@@ -194,7 +194,7 @@ inspect.styles = {
194194
'date': 'magenta',
195195
// "name": intentionally not styling
196196
'regexp': 'red'
197-
};
197+
});
198198

199199
const customInspectSymbol = internalUtil.customInspectSymbol;
200200

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.