File tree Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ class YahooFinance {
12
12
fetch : typeof fetch ;
13
13
fetchDevel ?: ( ) => Promise < typeof fetch > ;
14
14
} ;
15
- _logObj : ( obj : unknown ) => void ;
15
+ _logObj : ( obj : unknown , opts ?: { depth ?: number } ) => void ;
16
16
17
17
constructor ( options ?: YahooFinanceOptions ) {
18
18
/// XXX TODO mergeoptions from setGlobalConfig
@@ -60,7 +60,8 @@ class YahooFinance {
60
60
// @ts -ignore: relevant for ts-json-schema-generator
61
61
this . _logObj = Deno . stdout . isTerminal ( )
62
62
// deno-lint-ignore no-explicit-any
63
- ? ( obj : any ) => this . _opts . logger ! . dir ( obj , { depth : 4 , colors : true } )
63
+ ? ( obj : any , opts ?: { depth ?: number } ) =>
64
+ this . _opts . logger ! . dir ( obj , { depth : opts ?. depth ?? 4 , colors : true } )
64
65
// deno-lint-ignore no-explicit-any
65
66
: ( obj : any ) => this . _opts . logger ! . info ( JSON . stringify ( obj , null , 2 ) ) ;
66
67
}
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ export type ValidationError = {
21
21
export type ValidationCtx = {
22
22
definitions : JSONSchema [ "definitions" ] ;
23
23
logger : Logger ;
24
- logObj : ( obj : unknown ) => void ;
24
+ logObj : ( obj : unknown , opts ?: { depth ?: number } ) => void ;
25
25
} ;
26
26
27
27
export type Validator = (
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ export interface ValidateParams {
32
32
schemaKey : string ;
33
33
options : ValidationOptions ;
34
34
logger : Logger ;
35
- logObj : ( obj : unknown ) => void ;
35
+ logObj : ( obj : unknown , opts ?: { depth ?: number } ) => void ;
36
36
}
37
37
38
38
const doneAlready = new Map ( ) ;
@@ -241,7 +241,7 @@ function validate({
241
241
logger . info (
242
242
"The following result did not validate with schema: " + schemaKey ,
243
243
) ;
244
- logObj ( errors ) ;
244
+ logObj ( errors , { depth : 5 } ) ;
245
245
// logObj(object);
246
246
logger . info ( `
247
247
This may happen intermittently and you should catch errors appropriately.
You can’t perform that action at this time.
0 commit comments