File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -97,16 +97,18 @@ export function getDownloads(pkgs) {
97
97
98
98
export function getDependents ( pkgs ) {
99
99
return Promise . all (
100
- pkgs . map ( ( { name } ) =>
101
- got (
102
- `${ c . npmRegistryEndpoint } /_design/app/_view/dependedUpon?startkey=%5B%22${ name } %22%5D&endkey=%5B%22${ name } %22%2C%22%EF%BF%B0%22%5D&limit=1&reduce=true&stale=update_after` ,
100
+ pkgs . map ( ( { name } ) => {
101
+ const startKey = JSON . stringify ( [ name ] ) ;
102
+ const endKey = JSON . stringify ( [ name , { } ] ) ;
103
+ return got (
104
+ `${ c . npmRegistryEndpoint } /_design/app/_view/dependedUpon?startkey=${ startKey } &endkey=${ endKey } &stale=update_after` ,
103
105
{ json : true }
104
106
)
105
107
. then ( res => res . body . rows [ 0 ] || { value : 0 } )
106
108
. then ( ( { value } ) => ( {
107
109
dependents : value ,
108
110
humanDependents : numeral ( value ) . format ( '0.[0]a' ) ,
109
- } ) )
110
- )
111
+ } ) ) ;
112
+ } )
111
113
) ;
112
114
}
You can’t perform that action at this time.
0 commit comments