File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ export const defaultOptions: TraverseOptions = {
35
35
mutable : false ,
36
36
} ;
37
37
38
- const isCycle = ( s : JSONMetaSchema , recursiveStack : JSONMetaSchema [ ] ) => {
38
+ const isCycle = ( s : JSONMetaSchema , recursiveStack : JSONMetaSchema [ ] ) : JSONMetaSchema | false => {
39
39
const foundInRecursiveStack = recursiveStack . find ( ( recSchema ) => recSchema === s ) ;
40
40
if ( foundInRecursiveStack ) {
41
41
return foundInRecursiveStack ;
@@ -61,7 +61,7 @@ export default function traverse(
61
61
depth = 0 ,
62
62
recursiveStack : JSONMetaSchema [ ] = [ ] ,
63
63
prePostMap : Array < [ JSONMetaSchema , JSONMetaSchema ] > = [ ] ,
64
- ) {
64
+ ) : JSONMetaSchema {
65
65
let isRootOfCycle = false ;
66
66
67
67
// booleans are a bit messed. Since all other schemas are objects (non-primitive type
@@ -85,7 +85,7 @@ export default function traverse(
85
85
86
86
prePostMap . push ( [ schema , mutableSchema ] ) ;
87
87
88
- const rec = ( s : JSONMetaSchema ) => {
88
+ const rec = ( s : JSONMetaSchema ) : JSONMetaSchema => {
89
89
const foundCycle = isCycle ( s , recursiveStack ) ;
90
90
if ( foundCycle ) {
91
91
if ( foundCycle === schema ) { isRootOfCycle = true ; }
You can’t perform that action at this time.
0 commit comments