diff --git a/packages/identity/src/index.ts b/packages/identity/src/index.ts index 0722c5f3..d5ce73ae 100644 --- a/packages/identity/src/index.ts +++ b/packages/identity/src/index.ts @@ -4,7 +4,6 @@ import { Zencode } from "@restroom-mw/zencode"; import { NextFunction, Request, Response } from "express"; import axios from "axios"; import { Action } from "./actions"; -import { chunks } from "@restroom-mw/http/src/utils"; export default (req: Request, res: Response, next: NextFunction) => { const rr = new Restroom(req, res); @@ -22,21 +21,21 @@ export default (req: Request, res: Response, next: NextFunction) => { content = rr.combineDataKeys(data, keys); if (zencode.match(Action.RESOLVE_DID)) { - for (let [did, urlName, o] of chunks(zencode.paramsOf(Action.RESOLVE_DID), 3)) { + for (let [did, urlName, o] of zencode.chunkedParamsOf(Action.RESOLVE_DID, 3)) { let check_url : URL; let url_resolver : URL; try { - check_url = new URL(content[urlName]); + check_url = new URL(content[urlName as string]); } catch (err) { - throw new Error("The string " + content[urlName] + " is an invalid URL"); + throw new Error("The string " + content[urlName as string] + " is an invalid URL"); } try{ - url_resolver = new URL(check_url.toString() + "/" + content[did]); + url_resolver = new URL(check_url.toString() + "/" + content[did as string]); } catch(err){ - throw new Error("The string " + content[did] + " is an invalid URL"); + throw new Error("The string " + content[did as string] + " is an invalid URL"); } promises.push(axios.get(url_resolver.toString())); - outputs.push(o); + outputs.push(o as string); } } if(promises.length){