@@ -4,7 +4,6 @@ import { Zencode } from "@restroom-mw/zencode";
44import { NextFunction , Request , Response } from "express" ;
55import axios from "axios" ;
66import { Action } from "./actions" ;
7- import { chunks } from "@restroom-mw/http/src/utils" ;
87
98export default ( req : Request , res : Response , next : NextFunction ) => {
109 const rr = new Restroom ( req , res ) ;
@@ -22,21 +21,21 @@ export default (req: Request, res: Response, next: NextFunction) => {
2221 content = rr . combineDataKeys ( data , keys ) ;
2322
2423 if ( zencode . match ( Action . RESOLVE_DID ) ) {
25- for ( let [ did , urlName , o ] of chunks ( zencode . paramsOf ( Action . RESOLVE_DID ) , 3 ) ) {
24+ for ( let [ did , urlName , o ] of zencode . chunkedParamsOf ( Action . RESOLVE_DID , 3 ) ) {
2625 let check_url : URL ;
2726 let url_resolver : URL ;
2827 try {
29- check_url = new URL ( content [ urlName ] ) ;
28+ check_url = new URL ( content [ urlName as string ] ) ;
3029 } catch ( err ) {
31- throw new Error ( "The string " + content [ urlName ] + " is an invalid URL" ) ;
30+ throw new Error ( "The string " + content [ urlName as string ] + " is an invalid URL" ) ;
3231 }
3332 try {
34- url_resolver = new URL ( check_url . toString ( ) + "/" + content [ did ] ) ;
33+ url_resolver = new URL ( check_url . toString ( ) + "/" + content [ did as string ] ) ;
3534 } catch ( err ) {
36- throw new Error ( "The string " + content [ did ] + " is an invalid URL" ) ;
35+ throw new Error ( "The string " + content [ did as string ] + " is an invalid URL" ) ;
3736 }
3837 promises . push ( axios . get ( url_resolver . toString ( ) ) ) ;
39- outputs . push ( o ) ;
38+ outputs . push ( o as string ) ;
4039 }
4140 }
4241 if ( promises . length ) {
0 commit comments