File tree 2 files changed +20
-0
lines changed
2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -589,6 +589,17 @@ let MergeCases = {
589
589
can_merge : can_merge
590
590
} ;
591
591
592
+ function printLength ( json ) {
593
+ if ( typeof json !== "object" || json === null || Array . isArray ( json ) ) {
594
+ return ;
595
+ }
596
+ console . log ( "Length: " , Object . values ( json ) . length ) ;
597
+ }
598
+
599
+ let ObjectAndNull = {
600
+ printLength : printLength
601
+ } ;
602
+
592
603
let $$Array ;
593
604
594
605
let i = 42 ;
@@ -641,5 +652,6 @@ export {
641
652
Aliased ,
642
653
OnlyOne ,
643
654
MergeCases ,
655
+ ObjectAndNull ,
644
656
}
645
657
/* l2 Not a pure module */
Original file line number Diff line number Diff line change @@ -461,3 +461,11 @@ module MergeCases = {
461
461
| Boolean (_ ) => "merge"
462
462
}
463
463
}
464
+
465
+ module ObjectAndNull = {
466
+ let printLength = (json : JSON .t ) =>
467
+ switch json {
468
+ | Object (o ) => Console .log2 ("Length: " , o -> Dict .valuesToArray -> Array .length )
469
+ | _ => ()
470
+ }
471
+ }
You can’t perform that action at this time.
0 commit comments