File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed
Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 11'use strict' ;
2+ const {
3+ ErrorIsError,
4+ } = primordials ;
25
36/**
47 * Serializes an Error object
58 * @param {Error } error
69 * @returns {object }
710 */
811function serializeErr ( error ) {
9- if ( ! Error . isError ( error ) ) {
12+ if ( ! ErrorIsError ( error ) ) {
1013 return error ;
1114 }
1215
Original file line number Diff line number Diff line change 11'use strict' ;
2-
32const {
43 DateNow,
54 Error,
65 JSONStringify,
76 ObjectAssign,
7+ ObjectHasOwn,
88 ObjectKeys,
99 SafeSet,
1010} = primordials ;
1111
12+
1213const {
1314 codes : {
1415 ERR_INVALID_ARG_TYPE ,
@@ -80,12 +81,8 @@ class LogConsumer {
8081 * @returns {boolean }
8182 */
8283 enabled ( level ) {
83- if ( ! LEVELS . hasOwnProperty ( level ) ) {
84- throw new ERR_INVALID_ARG_VALUE (
85- 'level' ,
86- level ,
87- `must be one of: ${ LEVEL_NAMES . join ( ', ' ) } `
88- ) ;
84+ if ( ! ObjectHasOwn ( LEVELS , level ) ) {
85+ return false ;
8986 }
9087 return LEVELS [ level ] >= this . #levelValue;
9188 }
You can’t perform that action at this time.
0 commit comments