File tree Expand file tree Collapse file tree 1 file changed +3
-9
lines changed
src/registry/routes/helpers Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import request from 'minimal-request';
44import url from 'url' ;
55import { Component , Config } from '../../../types' ;
66import * as urlBuilder from '../../domain/url-builder' ;
7+ import { GetComponentResult } from './get-component' ;
78
89type ComponentCallback = (
910 err : { registryError : any ; fallbackError : any } | null ,
@@ -77,14 +78,7 @@ export function getComponent(
7778 fallbackRegistryUrl : string ,
7879 headers : IncomingHttpHeaders ,
7980 component : { name : string ; version : string ; parameters : IncomingHttpHeaders } ,
80- callback : (
81- result :
82- | {
83- status : number ;
84- response : { code : string ; error : Error } ;
85- }
86- | Component
87- ) => void
81+ callback : ( result : GetComponentResult ) => void
8882) : void {
8983 return request (
9084 {
@@ -94,7 +88,7 @@ export function getComponent(
9488 json : true ,
9589 body : { components : [ component ] }
9690 } ,
97- ( err , res : Component [ ] ) => {
91+ ( err , res : GetComponentResult [ ] ) => {
9892 if ( err || ! res || res . length === 0 ) {
9993 return callback ( {
10094 status : 404 ,
You can’t perform that action at this time.
0 commit comments