@bp1222/stats-api 0.2.5 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -279,6 +279,10 @@ function querystringSingleKey(key, value, keyPrefix = "") {
279
279
  }
280
280
  return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`;
281
281
  }
282
+ function exists(json, key) {
283
+ const value = json[key];
284
+ return value !== null && value !== void 0;
285
+ }
282
286
  function mapValues(data, fn) {
283
287
  return Object.keys(data).reduce(
284
288
  (acc, key) => __spreadProps(__spreadValues({}, acc), { [key]: fn(data[key]) }),
@@ -335,6 +339,97 @@ var TextApiResponse = class {
335
339
  }
336
340
  };
337
341
 
342
+ // src/models/BattingStats.ts
343
+ function instanceOfBattingStats(value) {
344
+ return true;
345
+ }
346
+ function BattingStatsFromJSON(json) {
347
+ return BattingStatsFromJSONTyped(json, false);
348
+ }
349
+ function BattingStatsFromJSONTyped(json, ignoreDiscriminator) {
350
+ if (json == null) {
351
+ return json;
352
+ }
353
+ return {
354
+ "flyOuts": json["flyOuts"] == null ? void 0 : json["flyOuts"],
355
+ "groundOuts": json["groundOuts"] == null ? void 0 : json["groundOuts"],
356
+ "airOuts": json["airOuts"] == null ? void 0 : json["airOuts"],
357
+ "runs": json["runs"] == null ? void 0 : json["runs"],
358
+ "doubles": json["doubles"] == null ? void 0 : json["doubles"],
359
+ "triples": json["triples"] == null ? void 0 : json["triples"],
360
+ "homeRuns": json["homeRuns"] == null ? void 0 : json["homeRuns"],
361
+ "strikeOuts": json["strikeOuts"] == null ? void 0 : json["strikeOuts"],
362
+ "baseOnBalls": json["baseOnBalls"] == null ? void 0 : json["baseOnBalls"],
363
+ "intentionalWalks": json["intentionalWalks"] == null ? void 0 : json["intentionalWalks"],
364
+ "hits": json["hits"] == null ? void 0 : json["hits"],
365
+ "hitByPitch": json["hitByPitch"] == null ? void 0 : json["hitByPitch"],
366
+ "avg": json["avg"] == null ? void 0 : json["avg"],
367
+ "atBats": json["atBats"] == null ? void 0 : json["atBats"],
368
+ "obp": json["obp"] == null ? void 0 : json["obp"],
369
+ "slg": json["slg"] == null ? void 0 : json["slg"],
370
+ "ops": json["ops"] == null ? void 0 : json["ops"],
371
+ "caughtStealing": json["caughtStealing"] == null ? void 0 : json["caughtStealing"],
372
+ "stolenBases": json["stolenBases"] == null ? void 0 : json["stolenBases"],
373
+ "stolenBasePercentage": json["stolenBasePercentage"] == null ? void 0 : json["stolenBasePercentage"],
374
+ "groundIntoDoublePlay": json["groundIntoDoublePlay"] == null ? void 0 : json["groundIntoDoublePlay"],
375
+ "groundIntoTriplePlay": json["groundIntoTriplePlay"] == null ? void 0 : json["groundIntoTriplePlay"],
376
+ "plateAppearances": json["plateAppearances"] == null ? void 0 : json["plateAppearances"],
377
+ "totalBases": json["totalBases"] == null ? void 0 : json["totalBases"],
378
+ "rbi": json["rbi"] == null ? void 0 : json["rbi"],
379
+ "leftOnBase": json["leftOnBase"] == null ? void 0 : json["leftOnBase"],
380
+ "sacBunts": json["sacBunts"] == null ? void 0 : json["sacBunts"],
381
+ "sacFlies": json["sacFlies"] == null ? void 0 : json["sacFlies"],
382
+ "catchersInterference": json["catchersInterference"] == null ? void 0 : json["catchersInterference"],
383
+ "pickoffs": json["pickoffs"] == null ? void 0 : json["pickoffs"],
384
+ "atBatsPerHomeRun": json["atBatsPerHomeRun"] == null ? void 0 : json["atBatsPerHomeRun"],
385
+ "popOuts": json["popOuts"] == null ? void 0 : json["popOuts"],
386
+ "lineOuts": json["lineOuts"] == null ? void 0 : json["lineOuts"]
387
+ };
388
+ }
389
+ function BattingStatsToJSON(json) {
390
+ return BattingStatsToJSONTyped(json, false);
391
+ }
392
+ function BattingStatsToJSONTyped(value, ignoreDiscriminator = false) {
393
+ if (value == null) {
394
+ return value;
395
+ }
396
+ return {
397
+ "flyOuts": value["flyOuts"],
398
+ "groundOuts": value["groundOuts"],
399
+ "airOuts": value["airOuts"],
400
+ "runs": value["runs"],
401
+ "doubles": value["doubles"],
402
+ "triples": value["triples"],
403
+ "homeRuns": value["homeRuns"],
404
+ "strikeOuts": value["strikeOuts"],
405
+ "baseOnBalls": value["baseOnBalls"],
406
+ "intentionalWalks": value["intentionalWalks"],
407
+ "hits": value["hits"],
408
+ "hitByPitch": value["hitByPitch"],
409
+ "avg": value["avg"],
410
+ "atBats": value["atBats"],
411
+ "obp": value["obp"],
412
+ "slg": value["slg"],
413
+ "ops": value["ops"],
414
+ "caughtStealing": value["caughtStealing"],
415
+ "stolenBases": value["stolenBases"],
416
+ "stolenBasePercentage": value["stolenBasePercentage"],
417
+ "groundIntoDoublePlay": value["groundIntoDoublePlay"],
418
+ "groundIntoTriplePlay": value["groundIntoTriplePlay"],
419
+ "plateAppearances": value["plateAppearances"],
420
+ "totalBases": value["totalBases"],
421
+ "rbi": value["rbi"],
422
+ "leftOnBase": value["leftOnBase"],
423
+ "sacBunts": value["sacBunts"],
424
+ "sacFlies": value["sacFlies"],
425
+ "catchersInterference": value["catchersInterference"],
426
+ "pickoffs": value["pickoffs"],
427
+ "atBatsPerHomeRun": value["atBatsPerHomeRun"],
428
+ "popOuts": value["popOuts"],
429
+ "lineOuts": value["lineOuts"]
430
+ };
431
+ }
432
+
338
433
  // src/models/Official.ts
339
434
  function instanceOfOfficial(value) {
340
435
  return true;
@@ -395,6 +490,458 @@ function GameOfficialToJSONTyped(value, ignoreDiscriminator = false) {
395
490
  };
396
491
  }
397
492
 
493
+ // src/models/FieldingStats.ts
494
+ function instanceOfFieldingStats(value) {
495
+ return true;
496
+ }
497
+ function FieldingStatsFromJSON(json) {
498
+ return FieldingStatsFromJSONTyped(json, false);
499
+ }
500
+ function FieldingStatsFromJSONTyped(json, ignoreDiscriminator) {
501
+ if (json == null) {
502
+ return json;
503
+ }
504
+ return {
505
+ "caughtStealing": json["caughtStealing"] == null ? void 0 : json["caughtStealing"],
506
+ "stolenBases": json["stolenBases"] == null ? void 0 : json["stolenBases"],
507
+ "stolenBasePercentage": json["stolenBasePercentage"] == null ? void 0 : json["stolenBasePercentage"],
508
+ "assists": json["assists"] == null ? void 0 : json["assists"],
509
+ "putOuts": json["putOuts"] == null ? void 0 : json["putOuts"],
510
+ "errors": json["errors"] == null ? void 0 : json["errors"],
511
+ "chances": json["chances"] == null ? void 0 : json["chances"],
512
+ "passedBall": json["passedBall"] == null ? void 0 : json["passedBall"],
513
+ "pickoffs": json["pickoffs"] == null ? void 0 : json["pickoffs"]
514
+ };
515
+ }
516
+ function FieldingStatsToJSON(json) {
517
+ return FieldingStatsToJSONTyped(json, false);
518
+ }
519
+ function FieldingStatsToJSONTyped(value, ignoreDiscriminator = false) {
520
+ if (value == null) {
521
+ return value;
522
+ }
523
+ return {
524
+ "caughtStealing": value["caughtStealing"],
525
+ "stolenBases": value["stolenBases"],
526
+ "stolenBasePercentage": value["stolenBasePercentage"],
527
+ "assists": value["assists"],
528
+ "putOuts": value["putOuts"],
529
+ "errors": value["errors"],
530
+ "chances": value["chances"],
531
+ "passedBall": value["passedBall"],
532
+ "pickoffs": value["pickoffs"]
533
+ };
534
+ }
535
+
536
+ // src/models/PitchingStats.ts
537
+ function instanceOfPitchingStats(value) {
538
+ return true;
539
+ }
540
+ function PitchingStatsFromJSON(json) {
541
+ return PitchingStatsFromJSONTyped(json, false);
542
+ }
543
+ function PitchingStatsFromJSONTyped(json, ignoreDiscriminator) {
544
+ if (json == null) {
545
+ return json;
546
+ }
547
+ return {
548
+ "flyOuts": json["flyOuts"] == null ? void 0 : json["flyOuts"],
549
+ "groundOuts": json["groundOuts"] == null ? void 0 : json["groundOuts"],
550
+ "airOuts": json["airOuts"] == null ? void 0 : json["airOuts"],
551
+ "runs": json["runs"] == null ? void 0 : json["runs"],
552
+ "doubles": json["doubles"] == null ? void 0 : json["doubles"],
553
+ "triples": json["triples"] == null ? void 0 : json["triples"],
554
+ "homeRuns": json["homeRuns"] == null ? void 0 : json["homeRuns"],
555
+ "strikeOuts": json["strikeOuts"] == null ? void 0 : json["strikeOuts"],
556
+ "baseOnBalls": json["baseOnBalls"] == null ? void 0 : json["baseOnBalls"],
557
+ "intentionalWalks": json["intentionalWalks"] == null ? void 0 : json["intentionalWalks"],
558
+ "hits": json["hits"] == null ? void 0 : json["hits"],
559
+ "hitByPitch": json["hitByPitch"] == null ? void 0 : json["hitByPitch"],
560
+ "atBats": json["atBats"] == null ? void 0 : json["atBats"],
561
+ "obp": json["obp"] == null ? void 0 : json["obp"],
562
+ "caughtStealing": json["caughtStealing"] == null ? void 0 : json["caughtStealing"],
563
+ "stolenBases": json["stolenBases"] == null ? void 0 : json["stolenBases"],
564
+ "stolenBasePercentage": json["stolenBasePercentage"] == null ? void 0 : json["stolenBasePercentage"],
565
+ "numberOfPitches": json["numberOfPitches"] == null ? void 0 : json["numberOfPitches"],
566
+ "era": json["era"] == null ? void 0 : json["era"],
567
+ "inningsPitched": json["inningsPitched"] == null ? void 0 : json["inningsPitched"],
568
+ "saveOpportunities": json["saveOpportunities"] == null ? void 0 : json["saveOpportunities"],
569
+ "earnedRuns": json["earnedRuns"] == null ? void 0 : json["earnedRuns"],
570
+ "whip": json["whip"] == null ? void 0 : json["whip"],
571
+ "battersFaced": json["battersFaced"] == null ? void 0 : json["battersFaced"],
572
+ "outs": json["outs"] == null ? void 0 : json["outs"],
573
+ "completeGames": json["completeGames"] == null ? void 0 : json["completeGames"],
574
+ "shutouts": json["shutouts"] == null ? void 0 : json["shutouts"],
575
+ "pitchesThrown": json["pitchesThrown"] == null ? void 0 : json["pitchesThrown"],
576
+ "balls": json["balls"] == null ? void 0 : json["balls"],
577
+ "strikes": json["strikes"] == null ? void 0 : json["strikes"],
578
+ "strikePercentage": json["strikePercentage"] == null ? void 0 : json["strikePercentage"],
579
+ "hitBatsmen": json["hitBatsmen"] == null ? void 0 : json["hitBatsmen"],
580
+ "balks": json["balks"] == null ? void 0 : json["balks"],
581
+ "wildPitches": json["wildPitches"] == null ? void 0 : json["wildPitches"],
582
+ "pickoffs": json["pickoffs"] == null ? void 0 : json["pickoffs"],
583
+ "groundOutsToAirouts": json["groundOutsToAirouts"] == null ? void 0 : json["groundOutsToAirouts"],
584
+ "rbi": json["rbi"] == null ? void 0 : json["rbi"],
585
+ "pitchesPerInning": json["pitchesPerInning"] == null ? void 0 : json["pitchesPerInning"],
586
+ "runsScoredPer9": json["runsScoredPer9"] == null ? void 0 : json["runsScoredPer9"],
587
+ "homeRunsPer9": json["homeRunsPer9"] == null ? void 0 : json["homeRunsPer9"],
588
+ "inheritedRunners": json["inheritedRunners"] == null ? void 0 : json["inheritedRunners"],
589
+ "inheritedRunnersScored": json["inheritedRunnersScored"] == null ? void 0 : json["inheritedRunnersScored"],
590
+ "catchersInterference": json["catchersInterference"] == null ? void 0 : json["catchersInterference"],
591
+ "sacBunts": json["sacBunts"] == null ? void 0 : json["sacBunts"],
592
+ "sacFlies": json["sacFlies"] == null ? void 0 : json["sacFlies"],
593
+ "passedBall": json["passedBall"] == null ? void 0 : json["passedBall"],
594
+ "popOuts": json["popOuts"] == null ? void 0 : json["popOuts"],
595
+ "lineOuts": json["lineOuts"] == null ? void 0 : json["lineOuts"]
596
+ };
597
+ }
598
+ function PitchingStatsToJSON(json) {
599
+ return PitchingStatsToJSONTyped(json, false);
600
+ }
601
+ function PitchingStatsToJSONTyped(value, ignoreDiscriminator = false) {
602
+ if (value == null) {
603
+ return value;
604
+ }
605
+ return {
606
+ "flyOuts": value["flyOuts"],
607
+ "groundOuts": value["groundOuts"],
608
+ "airOuts": value["airOuts"],
609
+ "runs": value["runs"],
610
+ "doubles": value["doubles"],
611
+ "triples": value["triples"],
612
+ "homeRuns": value["homeRuns"],
613
+ "strikeOuts": value["strikeOuts"],
614
+ "baseOnBalls": value["baseOnBalls"],
615
+ "intentionalWalks": value["intentionalWalks"],
616
+ "hits": value["hits"],
617
+ "hitByPitch": value["hitByPitch"],
618
+ "atBats": value["atBats"],
619
+ "obp": value["obp"],
620
+ "caughtStealing": value["caughtStealing"],
621
+ "stolenBases": value["stolenBases"],
622
+ "stolenBasePercentage": value["stolenBasePercentage"],
623
+ "numberOfPitches": value["numberOfPitches"],
624
+ "era": value["era"],
625
+ "inningsPitched": value["inningsPitched"],
626
+ "saveOpportunities": value["saveOpportunities"],
627
+ "earnedRuns": value["earnedRuns"],
628
+ "whip": value["whip"],
629
+ "battersFaced": value["battersFaced"],
630
+ "outs": value["outs"],
631
+ "completeGames": value["completeGames"],
632
+ "shutouts": value["shutouts"],
633
+ "pitchesThrown": value["pitchesThrown"],
634
+ "balls": value["balls"],
635
+ "strikes": value["strikes"],
636
+ "strikePercentage": value["strikePercentage"],
637
+ "hitBatsmen": value["hitBatsmen"],
638
+ "balks": value["balks"],
639
+ "wildPitches": value["wildPitches"],
640
+ "pickoffs": value["pickoffs"],
641
+ "groundOutsToAirouts": value["groundOutsToAirouts"],
642
+ "rbi": value["rbi"],
643
+ "pitchesPerInning": value["pitchesPerInning"],
644
+ "runsScoredPer9": value["runsScoredPer9"],
645
+ "homeRunsPer9": value["homeRunsPer9"],
646
+ "inheritedRunners": value["inheritedRunners"],
647
+ "inheritedRunnersScored": value["inheritedRunnersScored"],
648
+ "catchersInterference": value["catchersInterference"],
649
+ "sacBunts": value["sacBunts"],
650
+ "sacFlies": value["sacFlies"],
651
+ "passedBall": value["passedBall"],
652
+ "popOuts": value["popOuts"],
653
+ "lineOuts": value["lineOuts"]
654
+ };
655
+ }
656
+
657
+ // src/models/PlayerSeasonStats.ts
658
+ function instanceOfPlayerSeasonStats(value) {
659
+ if (!("batting" in value) || value["batting"] === void 0) return false;
660
+ if (!("pitching" in value) || value["pitching"] === void 0) return false;
661
+ if (!("fielding" in value) || value["fielding"] === void 0) return false;
662
+ return true;
663
+ }
664
+ function PlayerSeasonStatsFromJSON(json) {
665
+ return PlayerSeasonStatsFromJSONTyped(json, false);
666
+ }
667
+ function PlayerSeasonStatsFromJSONTyped(json, ignoreDiscriminator) {
668
+ if (json == null) {
669
+ return json;
670
+ }
671
+ return {
672
+ "batting": BattingStatsFromJSON(json["batting"]),
673
+ "pitching": PitchingStatsFromJSON(json["pitching"]),
674
+ "fielding": FieldingStatsFromJSON(json["fielding"])
675
+ };
676
+ }
677
+ function PlayerSeasonStatsToJSON(json) {
678
+ return PlayerSeasonStatsToJSONTyped(json, false);
679
+ }
680
+ function PlayerSeasonStatsToJSONTyped(value, ignoreDiscriminator = false) {
681
+ if (value == null) {
682
+ return value;
683
+ }
684
+ return {
685
+ "batting": BattingStatsToJSON(value["batting"]),
686
+ "pitching": PitchingStatsToJSON(value["pitching"]),
687
+ "fielding": FieldingStatsToJSON(value["fielding"])
688
+ };
689
+ }
690
+
691
+ // src/models/PlayerGameStatus.ts
692
+ function instanceOfPlayerGameStatus(value) {
693
+ return true;
694
+ }
695
+ function PlayerGameStatusFromJSON(json) {
696
+ return PlayerGameStatusFromJSONTyped(json, false);
697
+ }
698
+ function PlayerGameStatusFromJSONTyped(json, ignoreDiscriminator) {
699
+ if (json == null) {
700
+ return json;
701
+ }
702
+ return {
703
+ "isCurrentBatter": json["isCurrentBatter"] == null ? void 0 : json["isCurrentBatter"],
704
+ "isCurrentPitcher": json["isCurrentPitcher"] == null ? void 0 : json["isCurrentPitcher"],
705
+ "isOnBench": json["isOnBench"] == null ? void 0 : json["isOnBench"],
706
+ "isSubstitute": json["isSubstitute"] == null ? void 0 : json["isSubstitute"]
707
+ };
708
+ }
709
+ function PlayerGameStatusToJSON(json) {
710
+ return PlayerGameStatusToJSONTyped(json, false);
711
+ }
712
+ function PlayerGameStatusToJSONTyped(value, ignoreDiscriminator = false) {
713
+ if (value == null) {
714
+ return value;
715
+ }
716
+ return {
717
+ "isCurrentBatter": value["isCurrentBatter"],
718
+ "isCurrentPitcher": value["isCurrentPitcher"],
719
+ "isOnBench": value["isOnBench"],
720
+ "isSubstitute": value["isSubstitute"]
721
+ };
722
+ }
723
+
724
+ // src/models/Position.ts
725
+ function instanceOfPosition(value) {
726
+ return true;
727
+ }
728
+ function PositionFromJSON(json) {
729
+ return PositionFromJSONTyped(json, false);
730
+ }
731
+ function PositionFromJSONTyped(json, ignoreDiscriminator) {
732
+ if (json == null) {
733
+ return json;
734
+ }
735
+ return {
736
+ "code": json["code"] == null ? void 0 : json["code"],
737
+ "name": json["name"] == null ? void 0 : json["name"],
738
+ "type": json["type"] == null ? void 0 : json["type"],
739
+ "abbreviation": json["abbreviation"] == null ? void 0 : json["abbreviation"]
740
+ };
741
+ }
742
+ function PositionToJSON(json) {
743
+ return PositionToJSONTyped(json, false);
744
+ }
745
+ function PositionToJSONTyped(value, ignoreDiscriminator = false) {
746
+ if (value == null) {
747
+ return value;
748
+ }
749
+ return {
750
+ "code": value["code"],
751
+ "name": value["name"],
752
+ "type": value["type"],
753
+ "abbreviation": value["abbreviation"]
754
+ };
755
+ }
756
+
757
+ // src/models/PlayerPerson.ts
758
+ function instanceOfPlayerPerson(value) {
759
+ if (!("id" in value) || value["id"] === void 0) return false;
760
+ if (!("fullName" in value) || value["fullName"] === void 0) return false;
761
+ if (!("link" in value) || value["link"] === void 0) return false;
762
+ if (!("boxscoreName" in value) || value["boxscoreName"] === void 0) return false;
763
+ return true;
764
+ }
765
+ function PlayerPersonFromJSON(json) {
766
+ return PlayerPersonFromJSONTyped(json, false);
767
+ }
768
+ function PlayerPersonFromJSONTyped(json, ignoreDiscriminator) {
769
+ if (json == null) {
770
+ return json;
771
+ }
772
+ return {
773
+ "id": json["id"],
774
+ "fullName": json["fullName"],
775
+ "link": json["link"],
776
+ "boxscoreName": json["boxscoreName"]
777
+ };
778
+ }
779
+ function PlayerPersonToJSON(json) {
780
+ return PlayerPersonToJSONTyped(json, false);
781
+ }
782
+ function PlayerPersonToJSONTyped(value, ignoreDiscriminator = false) {
783
+ if (value == null) {
784
+ return value;
785
+ }
786
+ return {
787
+ "id": value["id"],
788
+ "fullName": value["fullName"],
789
+ "link": value["link"],
790
+ "boxscoreName": value["boxscoreName"]
791
+ };
792
+ }
793
+
794
+ // src/models/PlayerPosition.ts
795
+ function instanceOfPlayerPosition(value) {
796
+ return true;
797
+ }
798
+ function PlayerPositionFromJSON(json) {
799
+ return PlayerPositionFromJSONTyped(json, false);
800
+ }
801
+ function PlayerPositionFromJSONTyped(json, ignoreDiscriminator) {
802
+ if (json == null) {
803
+ return json;
804
+ }
805
+ return {
806
+ "code": json["code"] == null ? void 0 : json["code"],
807
+ "name": json["name"] == null ? void 0 : json["name"],
808
+ "type": json["type"] == null ? void 0 : json["type"],
809
+ "abbreviation": json["abbreviation"] == null ? void 0 : json["abbreviation"]
810
+ };
811
+ }
812
+ function PlayerPositionToJSON(json) {
813
+ return PlayerPositionToJSONTyped(json, false);
814
+ }
815
+ function PlayerPositionToJSONTyped(value, ignoreDiscriminator = false) {
816
+ if (value == null) {
817
+ return value;
818
+ }
819
+ return {
820
+ "code": value["code"],
821
+ "name": value["name"],
822
+ "type": value["type"],
823
+ "abbreviation": value["abbreviation"]
824
+ };
825
+ }
826
+
827
+ // src/models/PlayerStatus.ts
828
+ function instanceOfPlayerStatus(value) {
829
+ return true;
830
+ }
831
+ function PlayerStatusFromJSON(json) {
832
+ return PlayerStatusFromJSONTyped(json, false);
833
+ }
834
+ function PlayerStatusFromJSONTyped(json, ignoreDiscriminator) {
835
+ if (json == null) {
836
+ return json;
837
+ }
838
+ return {
839
+ "code": json["code"] == null ? void 0 : json["code"],
840
+ "description": json["description"] == null ? void 0 : json["description"]
841
+ };
842
+ }
843
+ function PlayerStatusToJSON(json) {
844
+ return PlayerStatusToJSONTyped(json, false);
845
+ }
846
+ function PlayerStatusToJSONTyped(value, ignoreDiscriminator = false) {
847
+ if (value == null) {
848
+ return value;
849
+ }
850
+ return {
851
+ "code": value["code"],
852
+ "description": value["description"]
853
+ };
854
+ }
855
+
856
+ // src/models/PlayerStats.ts
857
+ function instanceOfPlayerStats(value) {
858
+ if (!("batting" in value) || value["batting"] === void 0) return false;
859
+ if (!("pitching" in value) || value["pitching"] === void 0) return false;
860
+ if (!("fielding" in value) || value["fielding"] === void 0) return false;
861
+ return true;
862
+ }
863
+ function PlayerStatsFromJSON(json) {
864
+ return PlayerStatsFromJSONTyped(json, false);
865
+ }
866
+ function PlayerStatsFromJSONTyped(json, ignoreDiscriminator) {
867
+ if (json == null) {
868
+ return json;
869
+ }
870
+ return {
871
+ "batting": BattingStatsFromJSON(json["batting"]),
872
+ "pitching": PitchingStatsFromJSON(json["pitching"]),
873
+ "fielding": FieldingStatsFromJSON(json["fielding"])
874
+ };
875
+ }
876
+ function PlayerStatsToJSON(json) {
877
+ return PlayerStatsToJSONTyped(json, false);
878
+ }
879
+ function PlayerStatsToJSONTyped(value, ignoreDiscriminator = false) {
880
+ if (value == null) {
881
+ return value;
882
+ }
883
+ return {
884
+ "batting": BattingStatsToJSON(value["batting"]),
885
+ "pitching": PitchingStatsToJSON(value["pitching"]),
886
+ "fielding": FieldingStatsToJSON(value["fielding"])
887
+ };
888
+ }
889
+
890
+ // src/models/Player.ts
891
+ function instanceOfPlayer(value) {
892
+ if (!("person" in value) || value["person"] === void 0) return false;
893
+ if (!("position" in value) || value["position"] === void 0) return false;
894
+ if (!("stats" in value) || value["stats"] === void 0) return false;
895
+ if (!("seasonStats" in value) || value["seasonStats"] === void 0) return false;
896
+ return true;
897
+ }
898
+ function PlayerFromJSON(json) {
899
+ return PlayerFromJSONTyped(json, false);
900
+ }
901
+ function PlayerFromJSONTyped(json, ignoreDiscriminator) {
902
+ if (json == null) {
903
+ return json;
904
+ }
905
+ return {
906
+ "person": PlayerPersonFromJSON(json["person"]),
907
+ "jerseyNumber": json["jerseyNumber"] == null ? void 0 : json["jerseyNumber"],
908
+ "position": PlayerPositionFromJSON(json["position"]),
909
+ "status": json["status"] == null ? void 0 : PlayerStatusFromJSON(json["status"]),
910
+ "parentTeamId": json["parentTeamId"] == null ? void 0 : json["parentTeamId"],
911
+ "battingOrder": json["battingOrder"] == null ? void 0 : json["battingOrder"],
912
+ "stats": PlayerStatsFromJSON(json["stats"]),
913
+ "seasonStats": PlayerSeasonStatsFromJSON(json["seasonStats"]),
914
+ "gameStatus": json["gameStatus"] == null ? void 0 : PlayerGameStatusFromJSON(json["gameStatus"]),
915
+ "allPositions": json["allPositions"] == null ? void 0 : json["allPositions"].map(PositionFromJSON),
916
+ "type": json["type"] == null ? void 0 : json["type"],
917
+ "gameScore": json["gameScore"] == null ? void 0 : json["gameScore"],
918
+ "hittingGameScore": json["hittingGameScore"] == null ? void 0 : json["hittingGameScore"]
919
+ };
920
+ }
921
+ function PlayerToJSON(json) {
922
+ return PlayerToJSONTyped(json, false);
923
+ }
924
+ function PlayerToJSONTyped(value, ignoreDiscriminator = false) {
925
+ if (value == null) {
926
+ return value;
927
+ }
928
+ return {
929
+ "person": PlayerPersonToJSON(value["person"]),
930
+ "jerseyNumber": value["jerseyNumber"],
931
+ "position": PlayerPositionToJSON(value["position"]),
932
+ "status": PlayerStatusToJSON(value["status"]),
933
+ "parentTeamId": value["parentTeamId"],
934
+ "battingOrder": value["battingOrder"],
935
+ "stats": PlayerStatsToJSON(value["stats"]),
936
+ "seasonStats": PlayerSeasonStatsToJSON(value["seasonStats"]),
937
+ "gameStatus": PlayerGameStatusToJSON(value["gameStatus"]),
938
+ "allPositions": value["allPositions"] == null ? void 0 : value["allPositions"].map(PositionToJSON),
939
+ "type": value["type"],
940
+ "gameScore": value["gameScore"],
941
+ "hittingGameScore": value["hittingGameScore"]
942
+ };
943
+ }
944
+
398
945
  // src/models/LeagueDates.ts
399
946
  function instanceOfLeagueDates(value) {
400
947
  return true;
@@ -864,8 +1411,78 @@ function TeamToJSONTyped2(value, ignoreDiscriminator = false) {
864
1411
  };
865
1412
  }
866
1413
 
1414
+ // src/models/TeamStats.ts
1415
+ function instanceOfTeamStats(value) {
1416
+ if (!("batting" in value) || value["batting"] === void 0) return false;
1417
+ if (!("pitching" in value) || value["pitching"] === void 0) return false;
1418
+ if (!("fielding" in value) || value["fielding"] === void 0) return false;
1419
+ return true;
1420
+ }
1421
+ function TeamStatsFromJSON(json) {
1422
+ return TeamStatsFromJSONTyped(json, false);
1423
+ }
1424
+ function TeamStatsFromJSONTyped(json, ignoreDiscriminator) {
1425
+ if (json == null) {
1426
+ return json;
1427
+ }
1428
+ return {
1429
+ "batting": BattingStatsFromJSON(json["batting"]),
1430
+ "pitching": PitchingStatsFromJSON(json["pitching"]),
1431
+ "fielding": FieldingStatsFromJSON(json["fielding"])
1432
+ };
1433
+ }
1434
+ function TeamStatsToJSON(json) {
1435
+ return TeamStatsToJSONTyped(json, false);
1436
+ }
1437
+ function TeamStatsToJSONTyped(value, ignoreDiscriminator = false) {
1438
+ if (value == null) {
1439
+ return value;
1440
+ }
1441
+ return {
1442
+ "batting": BattingStatsToJSON(value["batting"]),
1443
+ "pitching": PitchingStatsToJSON(value["pitching"]),
1444
+ "fielding": FieldingStatsToJSON(value["fielding"])
1445
+ };
1446
+ }
1447
+
1448
+ // src/models/BoxscoreTeam.ts
1449
+ function instanceOfBoxscoreTeam(value) {
1450
+ if (!("team" in value) || value["team"] === void 0) return false;
1451
+ if (!("teamStats" in value) || value["teamStats"] === void 0) return false;
1452
+ if (!("players" in value) || value["players"] === void 0) return false;
1453
+ return true;
1454
+ }
1455
+ function BoxscoreTeamFromJSON(json) {
1456
+ return BoxscoreTeamFromJSONTyped(json, false);
1457
+ }
1458
+ function BoxscoreTeamFromJSONTyped(json, ignoreDiscriminator) {
1459
+ if (json == null) {
1460
+ return json;
1461
+ }
1462
+ return {
1463
+ "team": TeamFromJSON(json["team"]),
1464
+ "teamStats": TeamStatsFromJSON(json["teamStats"]),
1465
+ "players": mapValues(json["players"], PlayerFromJSON)
1466
+ };
1467
+ }
1468
+ function BoxscoreTeamToJSON(json) {
1469
+ return BoxscoreTeamToJSONTyped(json, false);
1470
+ }
1471
+ function BoxscoreTeamToJSONTyped(value, ignoreDiscriminator = false) {
1472
+ if (value == null) {
1473
+ return value;
1474
+ }
1475
+ return {
1476
+ "team": TeamToJSON(value["team"]),
1477
+ "teamStats": TeamStatsToJSON(value["teamStats"]),
1478
+ "players": mapValues(value["players"], PlayerToJSON)
1479
+ };
1480
+ }
1481
+
867
1482
  // src/models/BoxscoreTeams.ts
868
1483
  function instanceOfBoxscoreTeams(value) {
1484
+ if (!("away" in value) || value["away"] === void 0) return false;
1485
+ if (!("home" in value) || value["home"] === void 0) return false;
869
1486
  return true;
870
1487
  }
871
1488
  function BoxscoreTeamsFromJSON(json) {
@@ -876,8 +1493,8 @@ function BoxscoreTeamsFromJSONTyped(json, ignoreDiscriminator) {
876
1493
  return json;
877
1494
  }
878
1495
  return {
879
- "away": json["away"] == null ? void 0 : TeamFromJSON(json["away"]),
880
- "home": json["home"] == null ? void 0 : TeamFromJSON(json["home"])
1496
+ "away": BoxscoreTeamFromJSON(json["away"]),
1497
+ "home": BoxscoreTeamFromJSON(json["home"])
881
1498
  };
882
1499
  }
883
1500
  function BoxscoreTeamsToJSON(json) {
@@ -888,13 +1505,15 @@ function BoxscoreTeamsToJSONTyped(value, ignoreDiscriminator = false) {
888
1505
  return value;
889
1506
  }
890
1507
  return {
891
- "away": TeamToJSON(value["away"]),
892
- "home": TeamToJSON(value["home"])
1508
+ "away": BoxscoreTeamToJSON(value["away"]),
1509
+ "home": BoxscoreTeamToJSON(value["home"])
893
1510
  };
894
1511
  }
895
1512
 
896
1513
  // src/models/Boxscore.ts
897
1514
  function instanceOfBoxscore(value) {
1515
+ if (!("teams" in value) || value["teams"] === void 0) return false;
1516
+ if (!("officials" in value) || value["officials"] === void 0) return false;
898
1517
  return true;
899
1518
  }
900
1519
  function BoxscoreFromJSON(json) {
@@ -905,8 +1524,8 @@ function BoxscoreFromJSONTyped(json, ignoreDiscriminator) {
905
1524
  return json;
906
1525
  }
907
1526
  return {
908
- "teams": json["teams"] == null ? void 0 : BoxscoreTeamsFromJSON(json["teams"]),
909
- "officials": json["officials"] == null ? void 0 : json["officials"].map(GameOfficialFromJSON)
1527
+ "teams": BoxscoreTeamsFromJSON(json["teams"]),
1528
+ "officials": json["officials"].map(GameOfficialFromJSON)
910
1529
  };
911
1530
  }
912
1531
  function BoxscoreToJSON(json) {
@@ -918,7 +1537,7 @@ function BoxscoreToJSONTyped(value, ignoreDiscriminator = false) {
918
1537
  }
919
1538
  return {
920
1539
  "teams": BoxscoreTeamsToJSON(value["teams"]),
921
- "officials": value["officials"] == null ? void 0 : value["officials"].map(GameOfficialToJSON)
1540
+ "officials": value["officials"].map(GameOfficialToJSON)
922
1541
  };
923
1542
  }
924
1543
 
@@ -1929,9 +2548,17 @@ var MlbApi = class extends BaseAPI {
1929
2548
  export {
1930
2549
  BASE_PATH,
1931
2550
  BaseAPI,
2551
+ BattingStatsFromJSON,
2552
+ BattingStatsFromJSONTyped,
2553
+ BattingStatsToJSON,
2554
+ BattingStatsToJSONTyped,
1932
2555
  BlobApiResponse,
1933
2556
  BoxscoreFromJSON,
1934
2557
  BoxscoreFromJSONTyped,
2558
+ BoxscoreTeamFromJSON,
2559
+ BoxscoreTeamFromJSONTyped,
2560
+ BoxscoreTeamToJSON,
2561
+ BoxscoreTeamToJSONTyped,
1935
2562
  BoxscoreTeamsFromJSON,
1936
2563
  BoxscoreTeamsFromJSONTyped,
1937
2564
  BoxscoreTeamsToJSON,
@@ -1954,6 +2581,10 @@ export {
1954
2581
  DivisionToJSON,
1955
2582
  DivisionToJSONTyped,
1956
2583
  FetchError,
2584
+ FieldingStatsFromJSON,
2585
+ FieldingStatsFromJSONTyped,
2586
+ FieldingStatsToJSON,
2587
+ FieldingStatsToJSONTyped,
1957
2588
  GameFromJSON,
1958
2589
  GameFromJSONTyped,
1959
2590
  GameOfficialFromJSON,
@@ -2018,6 +2649,42 @@ export {
2018
2649
  OfficialFromJSONTyped,
2019
2650
  OfficialToJSON,
2020
2651
  OfficialToJSONTyped,
2652
+ PitchingStatsFromJSON,
2653
+ PitchingStatsFromJSONTyped,
2654
+ PitchingStatsToJSON,
2655
+ PitchingStatsToJSONTyped,
2656
+ PlayerFromJSON,
2657
+ PlayerFromJSONTyped,
2658
+ PlayerGameStatusFromJSON,
2659
+ PlayerGameStatusFromJSONTyped,
2660
+ PlayerGameStatusToJSON,
2661
+ PlayerGameStatusToJSONTyped,
2662
+ PlayerPersonFromJSON,
2663
+ PlayerPersonFromJSONTyped,
2664
+ PlayerPersonToJSON,
2665
+ PlayerPersonToJSONTyped,
2666
+ PlayerPositionFromJSON,
2667
+ PlayerPositionFromJSONTyped,
2668
+ PlayerPositionToJSON,
2669
+ PlayerPositionToJSONTyped,
2670
+ PlayerSeasonStatsFromJSON,
2671
+ PlayerSeasonStatsFromJSONTyped,
2672
+ PlayerSeasonStatsToJSON,
2673
+ PlayerSeasonStatsToJSONTyped,
2674
+ PlayerStatsFromJSON,
2675
+ PlayerStatsFromJSONTyped,
2676
+ PlayerStatsToJSON,
2677
+ PlayerStatsToJSONTyped,
2678
+ PlayerStatusFromJSON,
2679
+ PlayerStatusFromJSONTyped,
2680
+ PlayerStatusToJSON,
2681
+ PlayerStatusToJSONTyped,
2682
+ PlayerToJSON,
2683
+ PlayerToJSONTyped,
2684
+ PositionFromJSON,
2685
+ PositionFromJSONTyped,
2686
+ PositionToJSON,
2687
+ PositionToJSONTyped,
2021
2688
  RecordFromJSON,
2022
2689
  RecordFromJSONTyped,
2023
2690
  RecordToJSON,
@@ -2051,6 +2718,10 @@ export {
2051
2718
  StreakToJSONTyped,
2052
2719
  TeamFromJSON,
2053
2720
  TeamFromJSONTyped2 as TeamFromJSONTyped,
2721
+ TeamStatsFromJSON,
2722
+ TeamStatsFromJSONTyped,
2723
+ TeamStatsToJSON,
2724
+ TeamStatsToJSONTyped,
2054
2725
  TeamToJSON,
2055
2726
  TeamToJSONTyped2 as TeamToJSONTyped,
2056
2727
  TeamsFromJSON,
@@ -2064,11 +2735,15 @@ export {
2064
2735
  VenueToJSONTyped,
2065
2736
  VoidApiResponse,
2066
2737
  canConsumeForm,
2738
+ exists,
2739
+ instanceOfBattingStats,
2067
2740
  instanceOfBoxscore,
2741
+ instanceOfBoxscoreTeam,
2068
2742
  instanceOfBoxscoreTeams,
2069
2743
  instanceOfDivision,
2070
2744
  instanceOfDivisionStandings,
2071
2745
  instanceOfDivisionStandingsList,
2746
+ instanceOfFieldingStats,
2072
2747
  instanceOfGame,
2073
2748
  instanceOfGameOfficial,
2074
2749
  instanceOfGameStatus,
@@ -2084,6 +2759,15 @@ export {
2084
2759
  instanceOfLinescoreTeam,
2085
2760
  instanceOfLinescoreTeams,
2086
2761
  instanceOfOfficial,
2762
+ instanceOfPitchingStats,
2763
+ instanceOfPlayer,
2764
+ instanceOfPlayerGameStatus,
2765
+ instanceOfPlayerPerson,
2766
+ instanceOfPlayerPosition,
2767
+ instanceOfPlayerSeasonStats,
2768
+ instanceOfPlayerStats,
2769
+ instanceOfPlayerStatus,
2770
+ instanceOfPosition,
2087
2771
  instanceOfRecord,
2088
2772
  instanceOfSchedule,
2089
2773
  instanceOfScheduleDay,
@@ -2092,6 +2776,7 @@ export {
2092
2776
  instanceOfSport,
2093
2777
  instanceOfStreak,
2094
2778
  instanceOfTeam,
2779
+ instanceOfTeamStats,
2095
2780
  instanceOfTeams,
2096
2781
  instanceOfVenue,
2097
2782
  mapValues,