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
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: lib/util.js +4-4Lines changed: 4 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -166,7 +166,7 @@ Object.defineProperty(inspect, 'defaultOptions', { |
166 | 166 | }); |
167 | 167 |
|
168 | 168 | // http://en.wikipedia.org/wiki/ANSI_escape_code#graphics |
169 | | -inspect.colors = { |
| 169 | +inspect.colors = Object.assign(Object.create(null), { |
170 | 170 | 'bold': [1, 22], |
171 | 171 | 'italic': [3, 23], |
172 | 172 | 'underline': [4, 24], |
@@ -180,10 +180,10 @@ inspect.colors = { |
180 | 180 | 'magenta': [35, 39], |
181 | 181 | 'red': [31, 39], |
182 | 182 | 'yellow': [33, 39] |
183 | | -}; |
| 183 | +}); |
184 | 184 |
|
185 | 185 | // Don't use 'blue' not visible on cmd.exe |
186 | | -inspect.styles = { |
| 186 | +inspect.styles = Object.assign(Object.create(null), { |
187 | 187 | 'special': 'cyan', |
188 | 188 | 'number': 'yellow', |
189 | 189 | 'boolean': 'yellow', |
@@ -194,7 +194,7 @@ inspect.styles = { |
194 | 194 | 'date': 'magenta', |
195 | 195 | // "name": intentionally not styling |
196 | 196 | 'regexp': 'red' |
197 | | -}; |
| 197 | +}); |
198 | 198 |
|
199 | 199 | const customInspectSymbol = internalUtil.customInspectSymbol; |
200 | 200 |
|
|