@@ -525,14 +525,16 @@ let parsePkgs = data => {
525
525
| Object (dict {
526
526
"searchScore" : Number (searchScore ),
527
527
"score" : Object (dict {"detail" : Object (dict {"maintenance" : Number (maintenanceScore )})}),
528
- "package" : Object (
529
- dict {
530
- "name" : String (name ),
531
- "keywords" : Array (keywords ),
532
- "version" : String (version ),
533
- "links" : Object (dict {"npm" : String (npmHref )} as links ),
534
- } as package ,
535
- ),
528
+ "package" : Object (dict {
529
+ "name" : String (name ),
530
+ "keywords" : Array (keywords ),
531
+ "version" : String (version ),
532
+ "description" : ?Some (String (description )),
533
+ "links" : Object (dict {
534
+ "npm" : String (npmHref ),
535
+ "repository" : ?Some (String (repositoryHref )),
536
+ }),
537
+ }),
536
538
}) =>
537
539
let keywords =
538
540
keywords
@@ -545,22 +547,12 @@ let parsePkgs = data => {
545
547
-> Resource .filterKeywords
546
548
-> Resource .uniqueKeywords
547
549
548
- let repositoryHref = switch links -> Dict .get ("repository" ) {
549
- | Some (String (v )) => Null .Value (v )
550
- | _ => Null
551
- }
552
-
553
- let description = switch package {
554
- | dict {"description" : String (description )} => description
555
- | _ => ""
556
- }
557
-
558
550
Some ({
559
551
name ,
560
552
version ,
561
553
keywords ,
562
554
description ,
563
- repositoryHref ,
555
+ repositoryHref : repositoryHref -> Null . make ,
564
556
npmHref ,
565
557
searchScore ,
566
558
maintenanceScore ,
0 commit comments